I have a test JSF Page:
<!DOCTYPE html>
<html xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http:/java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head></h:head>
<h:body>
<h:form>
<h:commandButton id="testButton" value="test" action="#{sessionHandler.login}"></h:commandButton>
</h:form>
</h:body>
</html>
The commandButton calls a backing bean called SessionHandler:
import javax.faces.bean.SessionScoped;
import javax.inject.Inject;
import javax.inject.Named;
@Named
@SessionScoped
public class SessionHandler {
@Inject
private SessionEJB session = new SessionEJB();
public SessionHandler(){}
public String login(){
return "video.xhtml";
}
}
The problem is when I click the button, its not finding the backing bean method. I'm getting this error:
javax.servlet.ServletException: javax.el.PropertyNotFoundException: /test.xhtml @10,94 action="#{sessionHandler.login}": Target Unreachable, identifier 'sessionHandler' resolved to null
root cause
javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException: /test.xhtml @10,94 action="#{sessionHandler.login}": Target Unreachable, identifier 'sessionHandler' resolved to null
root cause
javax.el.PropertyNotFoundException: /test.xhtml @10,94 action="#{sessionHandler.login}": Target Unreachable, identifier 'sessionHandler' resolved to null
Why is it not finding my backing bean?