• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exclude url-patterns in web.xml's servlet-mapping?

 
Eric Martin
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm in a bit of a situation =) We have set up our web.xml as follows:


This has worked great until today when we added a 3rd party app that uses actualy html files. So now OurServlet tries to process any files that come from /3rdPartyApp/html/*.html. Is there any way to exclude anything that comes form /3rdPartyApp* in the servlet-mapping? Or is there any other way around this, besides changing the filenames or re-mapping our servlet =). The 3rd party app does not need a servlet entry.

TIA.
[ October 11, 2005: Message edited by: Eric Martin ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you have *.html. That will include everything. Just change that so that it more accurate. having *.html in the first place is what causes your problem, so don't try to fix your problem by adding something. fix the problem. You mapping should be specific to the detail level that it needs, not to the most generic, which causes maintenance problems later, like you are seeing now.

Mark
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mapping *.html to an active resource is a bad idea in any case. And I have the scars to prove it.

Sometimes, "helpful" servers along the way will cache resources that end with .html (or other known static types). This ended up, in a previous job, by serving up data for one customer to another. Yikes. AOL was a big problem with this respect.

I'd avoid mapping servlets to any pattern that could be mistaken for something other than a servlet.
 
Eric Martin
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the tips/advice. I changed the .html mapping to .do to fix the problem.
 
Eddy Lee Sin Ti
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although you already have a solution, just to let you know other possible workarounds.

You can have a forwarding servlet for /3rdPartyApp. The servlet just need to use RequestDispatcher to serve the html static files. Also, you can use Filter to achieve the same effect.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic