我该如何使用'<'在组件的value属性中

时间:2014-02-11 16:44:04

标签: jsf facelets

当我尝试使用值a4j:commandButton<<命名时 像那样

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

发生错误

我的调试跟踪

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 个答案:

答案 0 :(得分:4)

使用XML/HTML entities在XML文件中插入<>

value="&lt;&lt;"