Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: a_ilyin
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

Validation error removes all url parameters

Created: 18/Mar/13 08:57 PM   Updated: 08/Nov/13 09:15 PM
Component/s: Navigation
Affects Version/s: 2.2 Sprint 13
Fix Version/s: None

Time Tracking:
Not Specified

Participants: a_ilyin and arjan tijms

 Description  « Hide

This bug was copied from Mojarra issue tracker. See details here:

When page has some url parameter(s) after server-side validation error or by
default navigation JSF navigates to the page with the same viewId but without
url parameters.

IMHO the problem is the POST method submits the form to viewId's url only
instead of using url with the parameters as original url has.

This issue makes problems with bookmarking such views with params after handling
some action(minor problem) and generating proper response after action handling
based on this parameters(major problem) .

P.S. Also this issue has another side effect. When handling some action the url
parameters are unavailable.

I found some easy workaround for this problem.

I just slightly extend standard ViewHandler to add the queryString to the action

public class UrlWorkaroundMultiViewHandler extends MultiViewHandler {

public String getActionURL(FacesContext context, String viewId) {

String result = super.getActionURL(context, viewId);
String queryString = ((HttpServletRequest) context.getExternalContext()
if (queryString != null) { result += "?" + queryString; }
return result;


and register it in the faces-config.xml



I'm not sure this will work for any cases and for all servlet containers. Also
I'm not sure about possible side effects.
I did check it with Jetty.

UPDATE: I found that we have not add params when we handle new url. So I modify my workaround code to handle more cases:

public String getActionURL(FacesContext context, String viewId) {

String result = super.getActionURL(context, viewId);

HttpServletRequest request = ((HttpServletRequest) context

if (viewId.equals(request.getServletPath())) {
//Do it just if we are on the same page
String qs = request.getQueryString();
if (qs != null) { result += "?" + qs; }

return result;

Conclusion: I believe that any valid url should be preserved as is(including query parameters). Even we do not use its url parmas on our page.

arjan tijms added a comment - 20/Mar/13 04:02 PM

This looks like a duplicate of JAVASERVERFACES_SPEC_PUBLIC-1163.

Ed Burns made changes - 08/Nov/13 09:15 PM
Field Original Value New Value
Assignee rogerk [ rogerk ]