Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Works as designed
    • Affects Version/s: 2.0.2, 2.1.14
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All
      URL: http://forums.sun.com/thread.jspa?threadID=5438231

    • Issuezilla Id:
      1,653
    • Status Whiteboard:
      Hide

      size_medium importance_medium

      Show
      size_medium importance_medium

      Description

      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.

        Activity

        Hide
        a_ilyin added a comment -

        I found some easy workaround for this problem.

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

        public class UrlWorkaroundMultiViewHandler extends MultiViewHandler {

        @Override
        public String getActionURL(FacesContext context, String viewId) {

        String result = super.getActionURL(context, viewId);
        String queryString = ((HttpServletRequest) context.getExternalContext()
        .getRequest()).getQueryString();
        if (queryString != null)

        { result += "?" + queryString; }

        return result;

        }
        }

        and register it in the faces-config.xml

        <application>

        <view-handler>my.workaround.UrlWorkaroundMultiViewHandler</view-handler>
        </application>

        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.

        Show
        a_ilyin added a comment - I found some easy workaround for this problem. I just slightly extend standard ViewHandler to add the queryString to the action url: public class UrlWorkaroundMultiViewHandler extends MultiViewHandler { @Override public String getActionURL(FacesContext context, String viewId) { String result = super.getActionURL(context, viewId); String queryString = ((HttpServletRequest) context.getExternalContext() .getRequest()).getQueryString(); if (queryString != null) { result += "?" + queryString; } return result; } } and register it in the faces-config.xml <application> <view-handler>my.workaround.UrlWorkaroundMultiViewHandler</view-handler> </application> 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.
        Hide
        Ed Burns added a comment -

        Reassign to edburns

        Show
        Ed Burns added a comment - Reassign to edburns
        Hide
        rogerk added a comment -

        triage

        Show
        rogerk added a comment - triage
        Hide
        Ed Burns added a comment -

        Exclude these as impractical for GlassFish 3.1

        Show
        Ed Burns added a comment - Exclude these as impractical for GlassFish 3.1
        Hide
        Ed Burns added a comment -

        Exclude these issues from GlassFish 3.1. Reasons include:

        not important enough
        too risky

        Show
        Ed Burns added a comment - Exclude these issues from GlassFish 3.1. Reasons include: not important enough too risky
        Hide
        Manfred Riem added a comment -

        Can you please attach an example (with sources) that demonstrates the problem? Can you verify this is still an issue on the latest 2.1 release?

        Show
        Manfred Riem added a comment - Can you please attach an example (with sources) that demonstrates the problem? Can you verify this is still an issue on the latest 2.1 release?
        Hide
        a_ilyin added a comment -

        Yes javax.faces-2.1.14.jar still has the same error.

        In attach simple demo. I did not use f:viewParam for my simple code. Just plain url with query params.
        However as I remember f:viewParam did not resolve the issue as well.

        Think that any valid url should be preserved as is. Even we do not use its url parmas on our page.

        Show
        a_ilyin added a comment - Yes javax.faces-2.1.14.jar still has the same error. In attach simple demo. I did not use f:viewParam for my simple code. Just plain url with query params. However as I remember f:viewParam did not resolve the issue as well. Think that any valid url should be preserved as is. Even we do not use its url parmas on our page.
        Hide
        Manfred Riem added a comment -

        If you think those parameters need to be kept around please file a spec issue?

        Show
        Manfred Riem added a comment - If you think those parameters need to be kept around please file a spec issue?
        Show
        a_ilyin added a comment - Done. http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1175

          People

          • Assignee:
            Unassigned
            Reporter:
            a_ilyin
          • Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: