Reply To: Redirect to same page with changed viewParam

Splash Forums Rewrite Users Redirect to same page with changed viewParam Reply To: Redirect to same page with changed viewParam

#26651

Hmmm. Interesting issue.

It is correct that RewriteViewHandler#getActionURL(...) will basically return the requested URL. This is done because the form should post back to the same rewritten URL and not to the plain JSF URL. But I don’t see how this could cause the problem you are describing.

I’ll try to summarize what happens:

  1. You request the page WITH the view parameter, so the checkbox will be checked.
  2. You uncheck the checkbox which will trigger a postback to the same URL that was originally requested (WITH the view parameter)
  3. Your code triggers a redirect with “include-view-params=true” which will include the view parameters with the current values.

As far as I can tell the problem is in step 3. And I don’t think that Rewrite is involved here, is it? Or is RewriteViewHandler#getActionURL(...) called here?

Wouldn’t it solve your problem if you clear the bean property bound to the view parameter in step #3?