Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-961

When a URL rewriting rule changes the path for a rendered link (component event or page render), any query parameters associated with the original link are lost

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 5.1.0.5
    • 5.2.0
    • tapestry-core
    • None

    Description

      When a link is rewritten that contains parameters, the parameter information is not passed along to the newly created link. This creates a problem, for example, when the activation context "t:ac" is specified as a parameter in event links.

      Link rewriteIfNeeded(Link link, URLRewriteContext context)
      {
      Link newLink = null;
      SimpleRequestWrapper fakeRequest = new SimpleRequestWrapper(request, link.toAbsoluteURI());

      Request rewritten = urlRewriter.processLink(fakeRequest,context);

      // if the original request is equal to the rewritten one, no
      // rewriting is needed
      if (fakeRequest != rewritten)

      { final String originalServerName = request.getServerName(); final String rewrittenServerName = rewritten.getServerName(); boolean absolute = originalServerName.equals(rewrittenServerName) == false; final String newPath = rewritten.getPath(); String newUrl = absolute ? fullUrl(rewritten) : newPath; newLink = new LinkImpl(newUrl, false, false, response, null); (edit: ** newLink needs parameter information specified here) }

      return newLink;

      }

      Attachments

        1. tap5-961.patch
          0.7 kB
          Richard Bolkey

        Issue Links

          Activity

            People

              hlship Howard Lewis Ship
              rbolkey Richard Bolkey
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: