• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the tips/advice. I changed the .html mapping to .do to fix the problem.
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic