0

I need you help to fix an issue I have.

Currently in a Bean I'm referring to the service in that way:

@ManagedBean(name="sslbean")
public class SslBean implements Serializable {
...
...
@ManagedProperty("#{sslService}")
SslService service;
public void setService(SslService service) {
    this.service = service;
}
...
...

and the access to the SslService is working without any issue.

So I thought that I can do the same inside a RestController:

@RestController
@RequestMapping("/payment")
public class PaymentController {
...
...
@ManagedProperty("#{sslService}")
SslService service;

@PostConstruct
public void init() {
    this.ssl_list = service.listSsl();
}

public void setService(SslService service) {
    this.service = service;
}
...
...
...

but on runtime I get that the service is null ( no error during tomcat startup)

Can someone help me to understand that and how to fix?

thanks for your help.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Matt Vegas
  • 453
  • 5
  • 17

0 Answers0