Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

url-pattern

 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://tuckey.org/urlrewrite/
 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic