samedi 28 mars 2015

serverError: class javax.el.PropertyNotFoundException Target Unreachable, identifier 'userBean' resolved to null

My app is integrating jsf and hibernate and Spring


When i run my app this error displayed in browser and in IDE console window:



serverError: class javax.el.PropertyNotFoundException Target Unreachable, identifier 'userBean' resolved to null


Here is jsf page:



<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ift.tt/kkyg93">
<html xmlns="http://ift.tt/lH0Osb"
xmlns:h="http://ift.tt/J1LPWj"
xmlns:p="http://ift.tt/HjFrZc"
xmlns:f="http://ift.tt/19DXC4H">
<h:head>
</h:head>
<h:body>
<section id="loginBox">
<h:form id="myForm">
<p:panel id="loginPanel">
<p:focus context="loginPanel"/>
<h:panelGrid columns="3" >

<h:inputText id="email" value="#{userBean.email}" required="true" label="Email Address">
<f:validateRegex pattern="([^.@]+)(\.[^.@]+)*@([^.@]+\.)+([^.@]+)"/>
<f:ajax event="blur" render="emailMsg"/>
</h:inputText>
<h:message id="emailMsg" for="email"/>
<p:watermark for="email" value="Email"/>

<h:inputSecret id="password" value="#{userBean.password}" required="true" label="password">
<f:validateLength maximum="20" minimum="4"/>
<f:ajax event="blur" render="passwordMsg"/>
</h:inputSecret>
<h:message id="passwordMsg" for="password"/>
<p:watermark for="password" value="Password"/>

<h:commandButton id="loginbtn" value="Sign in" action="#{userBean.login()}">
<f:ajax execute="@form" render="@form"/>
</h:commandButton>
<h:outputLink value="loginHelp">Having Trouble singing in?</h:outputLink><br/>
</h:panelGrid>
<h:messages id="globalMsg" globalOnly="true" showSummary="true" showDetail="true"/>
</p:panel>
</h:form>
</section>
</h:body>


And this is userBean:



@Component
@Scope("session")
public class UserBean implements Serializable {

private String username;
private String password;
private String email;
private User currentUser;

@Autowired
private UserService userService;
//getter/setter and other methods
}

Aucun commentaire:

Enregistrer un commentaire