集操作的非法语法

编程入门 行业动态 更新时间:2024-10-21 05:58:24
本文介绍了集操作的非法语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在将xhtml页面连接到托管Bean时遇到问题,commandButton上的操作有效,但是在传递值时不起作用. 这是我的jsf代码:

I have a problem in connecting My xhtml page to the managed bean, the action on the commandButton works but when it comes to passing values it doesn't work. here is my jsf code:

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

我正在使用语素将数据映射到mongo db,我还有一个名为profil的实体和一个用于管理身份验证的bean.这是我的迷惑豆代码:

i'm using morphia to map data to mongo db, i have also an entitie called profil and one bean to manage authenfication. here is my athentication bean Code :

public class AuthenticationBean implements Serializable { private static final long serialVersionUID = 1L; private Profil profil; private ProfilDAO profileDao = DAOFactory.getProfilDAO(); public void validate() { FacesMessage message = new FacesMessage("Succès de l'inscription !"); FacesContext.getCurrentInstance().addMessage(null, message); } // getters and setters

这是我的个人资料代码:

here is my profil entitie code :

@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 ...

这是我提交一些数据并单击提交按钮时得到的错误:

this is the eror i get when i submit some data and click the submit button :

javax.el.PropertyNotWritableException: /index.xhtml @29,125 value=" #{authenticationBean.profil.login }": Illegal Syntax for Set Operation

推荐答案

仔细查看该值,并与所有理智的JSF教程/示例尝试向您展示的内容进行比较:

Look closer at the value and compare with what all sane JSF tutorials/examples try to show you:

value=" #{authenticationBean.profil.login }"

空白在属性和EL表达式中很重要.摆脱它:

Whitespace is significant in attributes and EL expressions. Get rid of it:

value="#{authenticationBean.profil.login}"

更多推荐

集操作的非法语法

本文发布于:2023-11-03 15:34:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555464.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:语法   操作

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!