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'
}