aspose file tools*
The moose likes Other Application Frameworks and the fly likes Stripes URL binding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Stripes URL binding" Watch "Stripes URL binding" New topic
Author

Stripes URL binding

Vadim Vararu
Ranch Hand

Joined: Jan 03, 2009
Posts: 147


this does not work when i type http://......./app/frontend/show, though if i do http://...../app/frontend/show.action, it's ok. What the problem? Should i change something i web.xml?


If you think you've done too much, usually it means you've done too few.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42908
    
  68
The most common setup for the StripesDispatcher servlet is to be mapped to *.action URLs. If you want it to be mapped to something else as well, then -yes- you'll need to add that to web.xml.
Vadim Vararu
Ranch Hand

Joined: Jan 03, 2009
Posts: 147
http://greggbolinger.blogspot.com/2008/01/stripes-15-feature-clean-urls.html

Interesting, but i couldn't find anything on web.xml in this article....
I guess we have to declare in web.xml dynamicMappingFilter, but i couldn't find it anywhere in internet....
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42908
    
  68
No, it doesn't talk about web.xml, but note that all URLBindings start with "/action/...", while the actual URLs are something like "http://.../app/action/...". So I bet that StripesDispatcher is mapped to "/action/*". After all, if an incoming request isn't mapped to a servlet, then there's nothing the servlet can do about it.
Vadim Vararu
Ranch Hand

Joined: Jan 03, 2009
Posts: 147
Don't bet, cause you can lose

It does not work. I'm not 100% sure, but that's how i got it to work. When we wanna use binding, we have to replace dispatcher servlet with dynamicMappingFIlter. At least this worken for me. I couldn't obtain result with something like /* in dispatcher servlet.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Vadim Vararu wrote:Don't bet, cause you can lose

It does not work. I'm not 100% sure, but that's how i got it to work. When we wanna use binding, we have to replace dispatcher servlet with dynamicMappingFIlter. At least this worken for me. I couldn't obtain result with something like /* in dispatcher servlet.


Yep, all that makes sense. Servlets won't work without a url pattern and they won't work right with /*. That is why DynamicMappingFilter was created. Unless you need to do something special with DispatcherServlet, there is no need to define it if you use DMF (DMF creates a DispatcherServlet for you). I use DMF exclusively now and have no problems. There are also lots of UrlBinding enhancements in Stripes 1.5.1 which was recently released.

To be clear, DispatcherServlet requires something like /action/* or *.action or /bla/*, etc. DMF does not and works without special prefixes or suffixes, just as clean URL's should.


GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stripes URL binding