tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Bolkey (JIRA)" <j...@apache.org>
Subject [jira] Created: (TAP5-961) ComponentEventLinkEncoderMethodAdvice#rewriteIfNeeded drops parameters when rewriting links.
Date Tue, 29 Dec 2009 19:39:29 GMT
ComponentEventLinkEncoderMethodAdvice#rewriteIfNeeded drops parameters when rewriting links.

                 Key: TAP5-961
                 URL: https://issues.apache.org/jira/browse/TAP5-961
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions:
            Reporter: Richard Bolkey

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;


This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message