• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF redirect

 
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I read as

<redirect/> is an optional element which can be used to specify that the response is generated by the new view using redirect response rather than rendering the response as the current request. If we don't specify this element then the address bar shows the current page address even the response is generated by other page.


I have not understood what author meant. Why we have to use redirect within navigation-case of navigation rule within faces-config. Can you please advise. Any ideas, suggestions, links, resources, sample code highly appreciated. Thanks in advance
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unlike most web frameworks, the URL isn't a direct connection to a fixed resource in JSF. It's more of a session handle, That's why you can go to "http://localhost/myapp/listPages.jsf", click a control or link to edit a page, and still see the "listpages.jsf" in the browser navigation control instead of the "editpage.jsf" that actually handles the editing function.

By using the <redirect /> navigation element, you can force the listpages.jsf URL to display instead, at the cost of some additional overhead.

There are 3 reasons why you might want to to do this:

1. You're obsessive about URLs showing up "right" and don't care that it will cost extra.

2. You want the actual URL so that people can bookmark it

3. You're using J2EE security. J2EE security is applied based on the incoming URL, not on the resources accessed by the URL, so someone who doesn't have edit privileges shouldn't be able to use the "listpages.jsf" URL case I mentioned up above as a security loophole.
 
I'm just a poor boy, I need no sympathy, because I'm easy come, easy go, little high, little low, little ad
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic