Reply To: Problem with link generation with language parameter.

Splash Forums PrettyFaces Users Problem with link generation with language parameter. Reply To: Problem with link generation with language parameter.

#24484

Marcin Kapusta
Participant

Lincoln

I attached my project from eclipse. It use maven 3 pom.xml
I running it on Tomcat 7.0.42, Java 7, Windows 7 32 bit

When You run it, type in your browser http://localhost:8080/web-base/pl/

Take a look at 3 links “About Us”.

UPDATE:
After reading this article: http://java.dzone.com/articles/bookmarkability-jsf-2 which help me a lot about understandings some concepts about url and parameters in JSF 2 I noticed that when I add to the view/about-us.xhtml file such lines after the line: template=”/WEB-INF/templates/base.xhtml”>

<f:metadata>
  <f:viewParam name="language" value="#{locale.language}" />
</f:metadata>

Then on the page http://localhost:8080/web-base/pl/ second and third link (About Us) is generated correctly.
It seems that in view I have to define metadata with viewParam’s when I want to use pretty faces to generate link to this view with parameters. Also note that the includeViewParams=”true” must be provided because default value of this attribute is false.


Regards
Marcin

  • This reply was modified 8 years, 5 months ago by  Marcin Kapusta. Reason: formatting, spelling
  • This reply was modified 8 years, 5 months ago by  Marcin Kapusta.
  • This reply was modified 8 years, 5 months ago by  Marcin Kapusta.
Attachments: