我如何使用'<'在组件的value属性中 [英] How can I use '<' in the value attribute of a component

查看:117
本文介绍了我如何使用'<'在组件的value属性中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试用值<<
来命名我的a4j:commandButton时 像这样

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

发生错误

我的调试跟踪

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)

推荐答案

使用 XML/HTML实体在XML文件中插入<>:

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

value="&lt;&lt;"

这篇关于我如何使用'&lt;'在组件的value属性中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆