But the output c...">

How to encode JSF outputLink value url

I have some code that looks something like this:

<h:outputLink value="#{bean.url}" /> 

But the output contains an apostrophe in the href link, which is not a URL encoded.

Am I doing something wrong or is this normal behavior for outputLink? Thanks in advance.

(JBoss 4.2, Java 1.6)

+6
java jsf urlencode
source share
1 answer

It really will not help you. It will be with the greatest jsessionid addition for the case when the client does not support cookies. Only link parameters that are added using <f:param> will be encoded in the URL.

 <h:outputLink value="#{bean.url}">Click <f:param name="param1" value="#{bean.urlParam1}" /> <f:param name="param2" value="#{bean.urlParam2}" /> </h:outputLink> 
+4
source share

All Articles