When I enter the page I want to rediect to another page with params (f:viewParam). How to do it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Add
includeViewParams=trueparameter to the outcome. JSF will then include the view params.Update as per the comments you seem to want to change the request/response inside the view side. This is not guaranteed to work. The view is part of the response. Once the response is committed, there is a point of no return. You cannot change the request/response to another destination.
You want to handle this in the controller instead. If those requests originate from a JSF action, then you should do the controlling job there. Just let it return the desired outcome. Or if those requests originate from external links/bookmarks/etc, then you should do the controlling job in a
Filterclass.