Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF URL annoyance in JSF 2?

 
E Cho
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most annoying thing I used to deal with in JSF 1.x was when using the JSF navigation... the URL never reflected the page that it was actually on, but the page before.

Has this been fixed in JSF 2?

Thanks!
 
Mahendra Pratap
Ranch Hand
Posts: 42
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know whether it has been fixed in jsf2 or not but for jsf 1.x you can fix this by using

before </navigation-case> end tag.
 
Ed Burns
author
Ranch Hand
Posts: 82
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
E Cho wrote:The most annoying thing I used to deal with in JSF 1.x was when using the JSF navigation... the URL never reflected the page that it was actually on, but the page before.

Has this been fixed in JSF 2?


As Mahendra Pratap pointed out, you can use the redirect in your navigation rules, but you can also use implicit navigation. For example, in any ActionSource2 component (h:commandButton, h:commandLink, etc)

You can say <h:commandButton action="next?faces-redirect=true" value="submit" /> and you'll get the redirect. This will cause the POST REDIRECT GET pattern to be followed. I have a big section on this starting on page 123 in the new book. This feature also works well with view parameters.

Ed
 
Lincoln Baxter
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also recommend the new <h:link> and <h:button> components to take advantage of JSF2's new simplified navigation system.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic