You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Richard Bolkey (JIRA)" <ji...@apache.org> on 2009/12/29 20:39:29 UTC

[jira] Created: (TAP5-961) ComponentEventLinkEncoderMethodAdvice#rewriteIfNeeded drops parameters when rewriting links.

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: 5.1.0.5
            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.


[jira] Assigned: (TAP5-961) ComponentEventLinkEncoderMethodAdvice#rewriteIfNeeded drops parameters when rewriting links.

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship reassigned TAP5-961:
-----------------------------------------

    Assignee: Howard M. Lewis Ship

> 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: 5.1.0.5
>            Reporter: Richard Bolkey
>            Assignee: Howard M. Lewis Ship
>         Attachments: tap5-961.patch
>
>
> 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.


[jira] Commented: (TAP5-961) ComponentEventLinkEncoderMethodAdvice#rewriteIfNeeded drops parameters when rewriting links.

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12837423#action_12837423 ] 

Howard M. Lewis Ship commented on TAP5-961:
-------------------------------------------

Also, this is a chance to remove the gratuitous use of method advice (rather than decoration).  Advice is when the underlying interface is not known, decoration is smarter when it is known (such as in this case, when a decorator is being put specifically around the ComponentEventLinkEncoder service).

> 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: 5.1.0.5
>            Reporter: Richard Bolkey
>            Assignee: Howard M. Lewis Ship
>         Attachments: tap5-961.patch
>
>
> 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.


[jira] Updated: (TAP5-961) ComponentEventLinkEncoderMethodAdvice#rewriteIfNeeded drops parameters when rewriting links.

Posted by "Richard Bolkey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Bolkey updated TAP5-961:
--------------------------------

    Attachment: tap5-961.patch

Adding a patch (albeit untested).

> 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: 5.1.0.5
>            Reporter: Richard Bolkey
>         Attachments: tap5-961.patch
>
>
> 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.


[jira] Closed: (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

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAP5-961.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 5.2.0

> 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
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-961
>                 URL: https://issues.apache.org/jira/browse/TAP5-961
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Richard Bolkey
>            Assignee: Howard M. Lewis Ship
>            Priority: Critical
>             Fix For: 5.2.0
>
>         Attachments: tap5-961.patch
>
>
> 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.


[jira] Closed: (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

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAP5-961.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 5.2.0

> 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
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-961
>                 URL: https://issues.apache.org/jira/browse/TAP5-961
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Richard Bolkey
>            Assignee: Howard M. Lewis Ship
>            Priority: Critical
>             Fix For: 5.2.0
>
>         Attachments: tap5-961.patch
>
>
> 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.


[jira] Updated: (TAP5-961) ComponentEventLinkEncoderMethodAdvice#rewriteIfNeeded drops parameters when rewriting links.

Posted by "Richard Bolkey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Bolkey updated TAP5-961:
--------------------------------

    Attachment: tap5-961.patch

Adding a patch (albeit untested).

> 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: 5.1.0.5
>            Reporter: Richard Bolkey
>         Attachments: tap5-961.patch
>
>
> 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.


[jira] Updated: (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

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-961:
--------------------------------------

    Priority: Critical  (was: Major)
     Summary: 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  (was: ComponentEventLinkEncoderMethodAdvice#rewriteIfNeeded drops parameters when rewriting links.)

> 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
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-961
>                 URL: https://issues.apache.org/jira/browse/TAP5-961
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Richard Bolkey
>            Assignee: Howard M. Lewis Ship
>            Priority: Critical
>             Fix For: 5.2.0
>
>         Attachments: tap5-961.patch
>
>
> 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.


[jira] Assigned: (TAP5-961) ComponentEventLinkEncoderMethodAdvice#rewriteIfNeeded drops parameters when rewriting links.

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship reassigned TAP5-961:
-----------------------------------------

    Assignee: Howard M. Lewis Ship

> 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: 5.1.0.5
>            Reporter: Richard Bolkey
>            Assignee: Howard M. Lewis Ship
>         Attachments: tap5-961.patch
>
>
> 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.


[jira] Updated: (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

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-961:
--------------------------------------

    Priority: Critical  (was: Major)
     Summary: 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  (was: ComponentEventLinkEncoderMethodAdvice#rewriteIfNeeded drops parameters when rewriting links.)

> 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
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-961
>                 URL: https://issues.apache.org/jira/browse/TAP5-961
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Richard Bolkey
>            Assignee: Howard M. Lewis Ship
>            Priority: Critical
>             Fix For: 5.2.0
>
>         Attachments: tap5-961.patch
>
>
> 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.


[jira] Commented: (TAP5-961) ComponentEventLinkEncoderMethodAdvice#rewriteIfNeeded drops parameters when rewriting links.

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12837423#action_12837423 ] 

Howard M. Lewis Ship commented on TAP5-961:
-------------------------------------------

Also, this is a chance to remove the gratuitous use of method advice (rather than decoration).  Advice is when the underlying interface is not known, decoration is smarter when it is known (such as in this case, when a decorator is being put specifically around the ComponentEventLinkEncoder service).

> 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: 5.1.0.5
>            Reporter: Richard Bolkey
>            Assignee: Howard M. Lewis Ship
>         Attachments: tap5-961.patch
>
>
> 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.