简体   繁体   中英

How to redirect with params in JSF2?

When I enter the page I want to rediect to another page with params (f:viewParam). How to do it?

Add includeViewParams=true parameter 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 Filter class.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM