I'm still a beginner at JSF programming and I'm trying to do a little example to understand how it works. I'm facing the problem where the @PostConstruct method of a managed bean is never invoked (the instanciations in it are never made, and the println in it doesn't show a thing) I tried all sorts of managed beans (Session, Request...), but there is always the same problem !
My managed bean :
@ManagedBean(name = "helloWorldMBean")
@SessionScoped
public class HelloWorldMBean implements Serializable {
private static final long serialVersionUID = 1L;
private PortletRequest request;
private String nom;
private String prenom;
private String complement;
private BigDecimal age;
private String year;
/* getters and setters */
@PostConstruct
public void init() {
System.out.println("Hi !");
if (request == null) {
request = (PortletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
}
complement = "...";
nom = "Init";
System.out.println("Comp : " + complement);
}