Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet mapping question (web.xml)

 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Is there any way to tell the <url-pattern> to exclude certain items? This question must come up a lot since MVC frameworks love to filter stuff, including css, images, and js scripts! If not, does anyone know if this will be available in a future servlet spec?
Thanks
 
Shakeel Shaik
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, as of now we dont have a simple way like
<url-pattern-exclude>despisedUrl</url-pattern-exclude>
Though I would personally love to have it, since it happens to be a very common scenario.

Questions like these have been asked in the past.
You might want to read this.
http://www.coderanch.com/t/291555/JSP/java/exclude-url-pattern-from-servlet

 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK thanks. I wanted to avoid using a prefix since masking all of that with rules, etc in mod_jk is a pain and I really want short seo urls coming off of my domain name. I ended up just moving all of my images, css, js, etc to a web server so now I can filter everything using /*.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"shaks ss", please check your private messages for an important administrative matter.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andy Hahn wrote:OK thanks. I wanted to avoid using a prefix since masking all of that with rules, etc in mod_jk is a pain and I really want short seo urls coming off of my domain name. I ended up just moving all of my images, css, js, etc to a web server so now I can filter everything using /*.

Ugg! I'd never ever map /* -- too many pitfalls.

A prefix is the way to go; you can keep it short if you wish. As for mod_jk, that's a pain to deal with in any scenario. I assume you have a strong need for Apache for some reason?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic