开发者

Why I can't use tags inside f:attribue for h:outputFormat?

Question开发者_如何学Go appears during porting application from JSF 1.2 to JSF 2.0.3 (Mojarra). I have following code:

<h:outputFormat value="#{m.t_if_you_forget_password}" escape="false">
   <f:param value="<a href=\"/restore_password.jsf\">" />
   <f:param value="</a>" />
</h:outputFormat>

and got error:

Error Traced[line: 22] The value of attribute "value" associated with an element type "null" must not contain the '<' character. 

How to fix it? Why JSF (facelets?) reject it? What's wrong with < and > in f:param value?

BTW, if it can help: I'm use GlassFish 3.0.1

Thanks in advance!


You used an xml special character in your attribute's value:

<

The error says you must not do that, which is correct. You should use the declaration of these characters if they are not part of the xml-code of your document. In the case of the sign above replace them with

&lt; 

Further information can be found here: http://www.devx.com/tips/Tip/14068

PS: Also replace all > with &gt;


Rather put the link elements in the message itself and parameterize the link href.

Blah blah <a href="{0}">blah blah</a> blah blah

with

<f:param value="restore_password.jsf">


You need to replace the < and > inside f:param value, not before and after f:param itself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜