Jsf Set操作的语法非法
我在将我的xhtml页面连接到托管bean时遇到了问题,commandButton上的操作可以工作,但是当涉及到传递值时,它就不起作用了。 以下是我的jsf代码:Jsf Set操作的语法非法,jsf,cdi,el,managed-bean,Jsf,Cdi,El,Managed Bean,我在将我的xhtml页面连接到托管bean时遇到了问题,commandButton上的操作可以工作,但是当涉及到传递值时,它就不起作用了。 以下是我的jsf代码: <h:form id="form" class="form-signin"> <p:panel id="panel" header=" Authentification" style="" > <h:panelGrid columns="2" ro
<h:form id="form" class="form-signin">
<p:panel id="panel" header=" Authentification" style="" >
<h:panelGrid columns="2" rowClasses="3">
<h:outputLabel for="login" value="Nom d'utilisateur :" styleClass=""/>
<p:inputText id="login" value=" #{authenticationBean.profil.login }" required="true" label="login" >
<f:validateLength minimum="4" />
</p:inputText>
<h:outputLabel for="password" value="Mot de passe :" />
<p:password id="password" value=" #{authenticationBean.profil.password }" required="true" label="password" styleClass=""/>
<p:row>
<p:commandButton id="loginButton" value="Login" ajax="false" action="#{authenticationBean.validate}" />
<h:messages id="messages" globalOnly="false"/>
</p:row>
</h:panelGrid>
</p:panel>
</h:form>
这是我的profil实体代码:
@Entity("profils")
public class Profil {
@Id protected ObjectId _id;
protected String nomProfil,prenomProfil,login,password;
@Embedded protected List<Droit> droits;
@Reference protected Admin admin;
public Profil() {
}
//getters and setters ...
仔细查看该值,并与所有sane JSF教程/示例试图向您展示的内容进行比较:
value=" #{authenticationBean.profil.login }"
空格在属性和EL表达式中很重要。摆脱它:
value="#{authenticationBean.profil.login}"
看来你少了一个二传手。请在问题中添加设置程序代码。谢谢。我有一个类似的问题,Primefaces在花括号后有一个空格,并且得到了相同的错误
很难看到!这可能是一个瓶颈
value=" #{authenticationBean.profil.login }"
value="#{authenticationBean.profil.login}"