From: Cristian C <ott...@gm...> - 2012-05-16 14:33:10
|
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 <gk...@ka...> 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 > Str...@li... > https://lists.sourceforge.net/lists/listinfo/stripes-users > |