How can I use '<' in the value attribute of a component [duplicate]

一世执手 提交于 2019-12-04 05:07:09

问题


When I try to name my a4j:commandButton by the value <<
Like that

<a4j:commandButton id="myButton" 
    value="<<"
    render="myGrid"
    styleClass="style_btn"
    disabled="false" />

There is an error occure

My debugging trace

Error Traced[line: 88] The value of attribute "value" associated with an element type "null" must not contain the '<' character.] with root cause
javax.faces.view.facelets.FaceletException: Error Parsing /screens/s1.xhtml: Error Traced[line: 88] The value of attribute "value" associated with an element type "null" must not contain the '<' character.
    at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:390)
    at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:364)

回答1:


Use XML/HTML entities to insert < or > in an XML file :

value="&lt;&lt;"


来源:https://stackoverflow.com/questions/21707815/how-can-i-use-in-the-value-attribute-of-a-component

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