IAdapter
IAdapter

Reputation: 64827

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?

Upvotes: 0

Views: 388

Answers (1)

BalusC
BalusC

Reputation: 1109432

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.

Upvotes: 1

Related Questions