tags:

views:

86

answers:

3

Hello!

Question 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!

+1  A: 

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;

bitschnau
Unfortunately it does not work: Element type "f:param" must be followed by either attribute specifications, ">" or "/>".
php-coder
+1  A: 

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">
BalusC
In this case I move piece of view layer to localization, it's a pity ;(
php-coder
A: 

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

Jesse