Re: [Stripes-users] Mapping Root of Web App to an Action using Dynamic Mappings
W dniu 15.05.2012 22:43, Cristian C pisze: Have you seen http://www.tuckey.org/urlrewrite/ Yeah, I have. Perhaps it's NIH syndrome, but I didn't want to learn to customize it, own filter seemed a quicker solution. It does pretty much what your filter does and much more. My problem is that even with that, I Can't map / If I add a / I get startup errors.. It seems that once the app is initialized it tries to retrieve /,.. I really don't understand why yet but it causes a stack overflow. Sorry, I didn't think of that. When I deploy to Glassfish, I can set the context path in its deployment form and / works there... So I'm still totally out of ideas how to map / to an action mapped to @UrlBinding.. Only @UrlBinding(/) worked but it invokes the bean unwantedly.. I wonder if this is a bug?.. It's not a bug, someone explained it on this newsgroup before, AFAIR it's because Stripes matches URLs as the longest matching substring or something ;-) -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users
Re: [Stripes-users] Mapping Root of Web App to an Action using Dynamic Mappings
I figured out what was happening. It was matching actionbean for / when requesting /favicon.ico thus running it every time. I wasn't expecting this behaviour from the URL matcher. It matches very loosely and it's hard to control what I want matched. I thought /{bar} should match /favicon.ico, but / should not. Looks like it matches if the requested URL has the prefix as one of the Url Bindings. Do you think it's possible to change the behaviour by using a customized NameBasedActionResolver ? I think this is a pretty basic functionality and surprised it's so hard to achieve. It would've been really amazing if stripes had an annotation for the welcome ActionBean. :) On Wed, May 16, 2012 at 6:49 AM, Grzegorz Krugły g...@karko.net wrote: W dniu 15.05.2012 22:43, Cristian C pisze: Have you seen http://www.tuckey.org/urlrewrite/ Yeah, I have. Perhaps it's NIH syndrome, but I didn't want to learn to customize it, own filter seemed a quicker solution. It does pretty much what your filter does and much more. My problem is that even with that, I Can't map / If I add a / I get startup errors.. It seems that once the app is initialized it tries to retrieve /,.. I really don't understand why yet but it causes a stack overflow. Sorry, I didn't think of that. When I deploy to Glassfish, I can set the context path in its deployment form and / works there... So I'm still totally out of ideas how to map / to an action mapped to @UrlBinding.. Only @UrlBinding(/) worked but it invokes the bean unwantedly.. I wonder if this is a bug?.. It's not a bug, someone explained it on this newsgroup before, AFAIR it's because Stripes matches URLs as the longest matching substring or something ;-) -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users
Re: [Stripes-users] Mapping Root of Web App to an Action using Dynamic Mappings
W dniu 16.05.2012 16:32, Cristian C pisze: I thought /{bar} should match /favicon.ico, but / should not. Looks like it matches if the requested URL has the prefix as one of the Url Bindings. I've searched past discussion about this issue and found the ticket - http://www.stripesframework.org/jira/browse/STS-688 Do you think it's possible to change the behaviour by using a customized NameBasedActionResolver ? Probably. Never felt the need to do so, because my source of problems was really to deploy at / -- if my app gets requests to / at all, I can handle it from there with my UrlRewritingFilter :-) I think this is a pretty basic functionality and surprised it's so hard to achieve. It would've been really amazing if stripes had an annotation for the welcome ActionBean. :) The simple, recommended in past threads, solution to this is to have index.jsp forward to some action, or to use /someaction as welcome page (from what I read in the past discussion it is at least supported in Tomcat). I don't think a separate annotation is really needed, but I would like UrlBinding(/) to work as people expect -- and that means changing how URLs are matched (see STS-688 ticket I linked) at least for / -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users
Re: [Stripes-users] Mapping Root of Web App to an Action using Dynamic Mappings
Hi, You can add this kind of code in your action bean to fake a 404 until the bug is solved. if (!context.getRequest().getServletPath().equals(/)) { return new ErrorResolution(HttpServletResponse.SC_NOT_FOUND); } Christian -Message d'origine- De : gshegosh [mailto:g...@karko.net] Envoyé : May-16-12 10:52 AM À : Stripes Users List Objet : Re: [Stripes-users] Mapping Root of Web App to an Action using Dynamic Mappings W dniu 16.05.2012 16:32, Cristian C pisze: I thought /{bar} should match /favicon.ico, but / should not. Looks like it matches if the requested URL has the prefix as one of the Url Bindings. I've searched past discussion about this issue and found the ticket - http://www.stripesframework.org/jira/browse/STS-688 Do you think it's possible to change the behaviour by using a customized NameBasedActionResolver ? Probably. Never felt the need to do so, because my source of problems was really to deploy at / -- if my app gets requests to / at all, I can handle it from there with my UrlRewritingFilter :-) I think this is a pretty basic functionality and surprised it's so hard to achieve. It would've been really amazing if stripes had an annotation for the welcome ActionBean. :) The simple, recommended in past threads, solution to this is to have index.jsp forward to some action, or to use /someaction as welcome page (from what I read in the past discussion it is at least supported in Tomcat). I don't think a separate annotation is really needed, but I would like UrlBinding(/) to work as people expect -- and that means changing how URLs are matched (see STS-688 ticket I linked) at least for / -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users