javax.el.PropertyNotWritableException: /index.xhtml @29,118 value=“”: Illegal Syntax for Set Operation

我与影子孤独终老i 提交于 2019-12-01 06:46:14
BalusC

Please carefully read the exception message. The answer is straight in there.

javax.el.PropertyNotWritableException: /index.xhtml @29,118 value="": Illegal Syntax for Set Operation

At line 29, character 118 of /index.xhtml you've a value="". This is not a valid syntax for an EL value expression which should be writable through a setter method.

Normally, you specify the value attribute like so value="#{bean.property}" wherein the bean has a getProperty() and a setProperty() method conform javabeans specification.

It's likely this one:

<h:inputText  styleClass="form-login" title="Username" value="" size="30" maxlength="2048" />

I'm not sure why you specified the value like that. This is plain wrong. You should either remove it altogether

<h:inputText  styleClass="form-login" title="Username" size="30" maxlength="2048" />

or bind it to a valid bean property

<h:inputText  styleClass="form-login" title="Username" value="#{someBean.userName}" size="30" maxlength="2048" />

Please note that this problem has nothing to do with changing the JSF locale.


Unrelated to the concrete problem, nesting forms is illegal in HTML and therefore also in JSF. You should split the language selection and the user login over 2 separate forms. You don't want to submit the login data when you change the language. Further, you may find the hints in this answer helpful as to how to properly change the JSF locale: Localization in JSF, how to remember selected locale per session instead of per request/view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!