2
votes

I have following bean:

    @javax.inject.Named
    @javax.faces.view.ViewScoped
    public class UserController implements Serializable{

In my jsf page I am accesing it like:

    <h:outputText value="#{userController.model.detail.name}"/>

When I debug it I noticed that my @PostConstruct method is not called on userController so there must be some issue with creating bean. I have beans.xml file in WEB-INF/. I need something else in order to have CDI working. I am using Wildfly 8.1. I have no errors in logs. Edit: I have added my build.gradle

dependencies {
    compile 'com.sun.faces:jsf-api:2.2.7'
    testCompile group: 'junit', name: 'junit', version: '4.11'
    providedCompile 'org.jboss.spec:jboss-javaee-all-7.0:1.0.1.Final'
    compile group: 'org.primefaces', name: 'primefaces', version:'5.0'
    providedCompile group: 'javax.servlet', name: 'servlet-api', version:'2.5'
    providedCompile group: 'javax.servlet', name: 'jsp-api', version:'2.0'
}
1
Which CDI version are you using? I'm not sure, but I remember since CDI 1.1 you don't need beans.xml anymore.ConcurrentHashMap
I am using version from org.jboss.spec:jboss-javaee-all-7.0:1.0.1.Final which would be version 1.0John
Solved by adding missing jsf mapping in web.xml.John
@John: you should write it as an answer and accept it.palacsint
I can accept my own answer in 2 days.John

1 Answers

0
votes

Solved by adding missing jsf mapping in web.xml.