Home Jsf Jsftraining Using redirect element & wild card
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

Using redirect element & wild card

Advertisement
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.

Using redirect element & wild card

        

<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.

Specify navigation rule like below:

<navigation-rule>
   <from-view-id>/page/*</from-view-id>
   <navigation-case>
   <from-outcome>login</from-outcome>
   <to-view-id>/login.jsp</to-view-id>
   <redirect/>
   </navigation-case> 
</navigation-rule>

  • This navigation rule is defined for every jsf page of view id like "/page/*". Here * represents all the jsp pages in the page directory.
  • redirect element is used to show the new page url to the address bar.

 

Clicking the button redirects you to the login.jsp page as shown below: You can see the new page address at the address bar.

Download code for all examples

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 30, 2008

Related Tutorials

Ask Questions?    Discuss: Using redirect element & wild card  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com