1

I don't know why includeViewParams is not working when I use a h:link.

My first page is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org   /TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core">
<f:metadata>
   <f:viewParam name="a" />
   <f:viewParam name="c" />
</f:metadata>      
<h:head>
  <title>A Simple JavaServer Faces 2.0 View</title>
</h:head>
<h:body>
 <h:form>     
   <h:link outcome="page2" value="h:link" includeViewParams="true">     
   </h:link>    
 </h:form>
</h:body>
</html>

My second page (page2.xhml) is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"      
   xmlns:f="http://java.sun.com/jsf/core">
<f:metadata>
  <f:viewParam name="a" />      
  <f:viewParam name="c" />      
</f:metadata>      
<h:head>
   <title>A Simple JavaServer Faces 2.0 View</title>
</h:head>
<h:body>
   <h:form>
     PAGE 2
   </h:form>
</h:body>
</html>

When I do a click in the link parameters are not included in the URL.

I have read

What can <f:metadata>, <f:viewParam> and <f:viewAction> be used for?

but I don't know what I'm doing wrong.

Thanks

Community
  • 1
  • 1
Eduardo
  • 1,169
  • 5
  • 21
  • 56

1 Answers1

2

Looking in internet I found what was the problem.

I was doing everything right. It was a bug of JSF version library. I was working with jsf-api 2.1.7 and jsf-impl 2.1.7 and with this version doesn't work.

No problem with jsf-api 2.1.19 and jsf-impl 2.1.19.

https://java.net/jira/browse/JAVASERVERFACES-2718

Eduardo
  • 1,169
  • 5
  • 21
  • 56