aspose file tools*
The moose likes Servlets and the fly likes url-pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "url-pattern" Watch "url-pattern" New topic
Author

url-pattern

Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
Is there a way to exclude files from a servlet-mapping url-pattern in an upcoming servlet spec? This is totally ridiculous if the answer is no.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Not that I'm aware of, although it's pretty trivial to work around this with better application layout or a simple filter. Could be wrong though--haven't been keeping up.
Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
I am aware of the options, but I am intrigued by the servlet filter option. can you elaborate more on how that would work?
Kris Schneider
Ranch Hand

Joined: Feb 14, 2001
Posts: 71
http://tuckey.org/urlrewrite/
Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
Yeah I have used that, but man it can get messy fast. Especially with apache mod configs, and using taglibs to generate localized links (taglibs sometimes append on a session id). I think the easiest approach is to just put static files on a web server rather than embedding in a war/ear file. I hate to say that but its true. A servlet container is probably not the best place to store static content. So maybe thats why an exclude feature is not on the horizon even for the 3.0 servlet spec.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: url-pattern