[JIRA] Created: (STS-842) CLONE - UrlBindingFactory interprets parameters first in url as conflict

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[JIRA] Created: (STS-842) CLONE - UrlBindingFactory interprets parameters first in url as conflict

JIRA jira@stripesframework.org
CLONE - UrlBindingFactory interprets parameters first in url as conflict
------------------------------------------------------------------------

                 Key: STS-842
                 URL: http://www.stripesframework.org/jira/browse/STS-842
             Project: Stripes
          Issue Type: Bug
          Components: ActionBean Dispatching
    Affects Versions: Release 1.5.1, Release 1.5.2
            Reporter: Kris Luhr
            Assignee: Ben Gunter


I would like to have a parameter first in my urls, representing different sections of a site; eg: @UrlBinding("/{section}/foo/bar/{$event}.html")
This UrlBinding results in a conflict between all ActionBeans using the {section} parameter. While debugging I find the UrlBindingFactory.getBindingPrototype(String uri) method ignoring the componentMatch when checking if we have a conflict, which seems to be a bug. At least in this case the result is not logical.

Additionally when I use the url "/section1/foo/bar.html", the section parameter is set to "section1/foo/bar".
This works and gives me the default handler if I dont have the section as a parameter. Perhaps these two issues are related?

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

[JIRA] Updated: (STS-842) CLONE - UrlBindingFactory interprets parameters first in url as conflict

JIRA jira@stripesframework.org

     [ http://www.stripesframework.org/jira/browse/STS-842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kris Luhr updated STS-842:
--------------------------

    Attachment: stripes-urlbinding-problem.zip

Tests to reproduce the problem

> CLONE - UrlBindingFactory interprets parameters first in url as conflict
> ------------------------------------------------------------------------
>
>                 Key: STS-842
>                 URL: http://www.stripesframework.org/jira/browse/STS-842
>             Project: Stripes
>          Issue Type: Bug
>          Components: ActionBean Dispatching
>    Affects Versions: Release 1.5.1, Release 1.5.2
>            Reporter: Kris Luhr
>            Assignee: Ben Gunter
>         Attachments: stripes-urlbinding-problem.zip
>
>
> I would like to have a parameter first in my urls, representing different sections of a site; eg: @UrlBinding("/{section}/foo/bar/{$event}.html")
> This UrlBinding results in a conflict between all ActionBeans using the {section} parameter. While debugging I find the UrlBindingFactory.getBindingPrototype(String uri) method ignoring the componentMatch when checking if we have a conflict, which seems to be a bug. At least in this case the result is not logical.
> Additionally when I use the url "/section1/foo/bar.html", the section parameter is set to "section1/foo/bar".
> This works and gives me the default handler if I dont have the section as a parameter. Perhaps these two issues are related?

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (STS-842) CLONE - UrlBindingFactory interprets parameters first in url as conflict

JIRA jira@stripesframework.org
In reply to this post by JIRA jira@stripesframework.org

    [ http://www.stripesframework.org/jira/browse/STS-842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12371#comment-12371 ]

Kris Luhr commented on STS-842:
-------------------------------

Sorry that it has taken so long, I havent had the time to address this issue and create a minimalistic test suite until now.
Have upgraded to 1.5.6 and the problem still remains.

I think that as long as two UrlBindings are unique they should not be considered conflicting. The attached tests show that  [/{section}/stuff/bean1/{$event}.html, /{section}/stuff/bean2/{$event}.html] are considered conflicting.

I am not sure if my findings from debugging in 1.5.1 and 1.5.2 are relevant anymore, please ignore. Hope the attached test cases are clear enough to illustrate the issue.




> CLONE - UrlBindingFactory interprets parameters first in url as conflict
> ------------------------------------------------------------------------
>
>                 Key: STS-842
>                 URL: http://www.stripesframework.org/jira/browse/STS-842
>             Project: Stripes
>          Issue Type: Bug
>          Components: ActionBean Dispatching
>    Affects Versions: Release 1.5.1, Release 1.5.2
>            Reporter: Kris Luhr
>            Assignee: Ben Gunter
>         Attachments: stripes-urlbinding-problem.zip
>
>
> I would like to have a parameter first in my urls, representing different sections of a site; eg: @UrlBinding("/{section}/foo/bar/{$event}.html")
> This UrlBinding results in a conflict between all ActionBeans using the {section} parameter. While debugging I find the UrlBindingFactory.getBindingPrototype(String uri) method ignoring the componentMatch when checking if we have a conflict, which seems to be a bug. At least in this case the result is not logical.
> Additionally when I use the url "/section1/foo/bar.html", the section parameter is set to "section1/foo/bar".
> This works and gives me the default handler if I dont have the section as a parameter. Perhaps these two issues are related?

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (STS-842) CLONE - UrlBindingFactory interprets parameters first in url as conflict

JIRA jira@stripesframework.org
In reply to this post by JIRA jira@stripesframework.org

    [ http://www.stripesframework.org/jira/browse/STS-842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12372#comment-12372 ]

Kris Luhr commented on STS-842:
-------------------------------

Our workaround is to have one ActionBean for each section with the section specified explicitly in each UrlBinding.
eg.
@UrlBinding("/abc/stuff/bean1/{$event}.html")
public class SectionFirst1AbcAction implements ActionBean { ... }

@UrlBinding("/xyz/stuff/bean1/{$event}.html")
public class SectionFirst1XyzAction extends SectionFirst1Action { ... }

This works fine but gives us 3 times as many actionbeans.

> CLONE - UrlBindingFactory interprets parameters first in url as conflict
> ------------------------------------------------------------------------
>
>                 Key: STS-842
>                 URL: http://www.stripesframework.org/jira/browse/STS-842
>             Project: Stripes
>          Issue Type: Bug
>          Components: ActionBean Dispatching
>    Affects Versions: Release 1.5.1, Release 1.5.2
>            Reporter: Kris Luhr
>            Assignee: Ben Gunter
>         Attachments: stripes-urlbinding-problem.zip
>
>
> I would like to have a parameter first in my urls, representing different sections of a site; eg: @UrlBinding("/{section}/foo/bar/{$event}.html")
> This UrlBinding results in a conflict between all ActionBeans using the {section} parameter. While debugging I find the UrlBindingFactory.getBindingPrototype(String uri) method ignoring the componentMatch when checking if we have a conflict, which seems to be a bug. At least in this case the result is not logical.
> Additionally when I use the url "/section1/foo/bar.html", the section parameter is set to "section1/foo/bar".
> This works and gives me the default handler if I dont have the section as a parameter. Perhaps these two issues are related?

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (STS-842) CLONE - UrlBindingFactory interprets parameters first in url as conflict

JIRA jira@stripesframework.org
In reply to this post by JIRA jira@stripesframework.org

    [ http://www.stripesframework.org/jira/browse/STS-842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840#comment-12840 ]

Ken Koster commented on STS-842:
--------------------------------

There is a second unwanted behavior caused by this issue in UrlBindingFactory, one manifested when executing a RedirectResolution with a target of "/". Instead of a redirect to "/" ending up with the client requesting a welcome-file (as defined in the web.xml) at the context root, the redirect instead goes to the URL with a parameterized first URL component, with that first parameter bound to the empty string. This leads to a 404 error.

So in the case of the ActionBean presented in the original problem description, trying to redirect a user to "/" would result in a redirection to //foo/bar/.html

(I'm not sure how the last component will be interpolated and whether .html will be part of the produced URL. But which ever way it gets interpolated, the core problem is still there.)

At resolution execution time, the corresponding binding for "/" gets looked up in the UrlBindingFactory.pathCache. This cache is incorrectly populated with an entry that has a key of "/" and a UrlBinding object for the URL with a parameter in the first component.


> CLONE - UrlBindingFactory interprets parameters first in url as conflict
> ------------------------------------------------------------------------
>
>                 Key: STS-842
>                 URL: http://www.stripesframework.org/jira/browse/STS-842
>             Project: Stripes
>          Issue Type: Bug
>          Components: ActionBean Dispatching
>    Affects Versions: Release 1.5.1, Release 1.5.2
>            Reporter: Kris Luhr
>            Assignee: Ben Gunter
>         Attachments: stripes-urlbinding-problem.zip
>
>
> I would like to have a parameter first in my urls, representing different sections of a site; eg: @UrlBinding("/{section}/foo/bar/{$event}.html")
> This UrlBinding results in a conflict between all ActionBeans using the {section} parameter. While debugging I find the UrlBindingFactory.getBindingPrototype(String uri) method ignoring the componentMatch when checking if we have a conflict, which seems to be a bug. At least in this case the result is not logical.
> Additionally when I use the url "/section1/foo/bar.html", the section parameter is set to "section1/foo/bar".
> This works and gives me the default handler if I dont have the section as a parameter. Perhaps these two issues are related?

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development