Servlet Mapping with wildcards

From: Dale (dalew75_at_hotmail.com)
Date: 01/23/04


Date: 23 Jan 2004 07:58:55 -0800

Is there any way in the web.xml, to define the servlet mappings in
such a way that I want to map all urls, EXCEPT for particular
patterns.

Here is my problem.... I want to ensure that requests for CSS (*.css)
or JS (*.js) files don't submit a request to the server most of the
time (so the browser just uses its own cached version). Any other url
would hit a default filter or servlet, which would then delegate to
other appropriate servlets.

The only way I can think to do this would be to map all 3 and 2 letter
extensions that are not CSS or JS to this default filter. Is there no
NOT wildcard I can use or something?

Thanks,
Dale



Relevant Pages

  • Servlet Mapping with wildcards
    ... would hit a default filter or servlet, ... The only way I can think to do this would be to map all 3 and 2 letter ... extensions that are not CSS or JS to this default filter. ...
    (comp.lang.java.programmer)
  • Re: if else-Block ersetzen
    ... Diese wird ja nur einmal aufgerufen, bevor das Servlet vom Servlet-Container in Betrieb genommen wird, also beim Laden der Webapp. ... Da während der doPostbzw. doGetMethodenaufrufe nur lesend darauf zugegriffen wird ist dies kein Problem. ... Die Map ist vom Typ Map<String, ICommandProcessor>. ...
    (de.comp.lang.java)
  • Re: welcome-file-list entry with query string/variables? (tomcat)
    ... > But it fails because of the query string. ... You could map a servlet that redirects to that URL. ...
    (comp.lang.java.programmer)
  • Re: tomcat 5 serlvet question
    ... I mapped the servlet in web.xml with the word ... > function) but instead tries to map the whole URL to the unexistent resource? ... (I had an example WAR file for years ... Apparently you must map the URI and use that, ...
    (comp.lang.java.programmer)
  • Re: Tomcat and loginfailur with basic authentication
    ... >to redirect to some page that I define, actually to a servlet of mine. ... If your server is a stand-alone Tomcat, ... you map a servlet class into a servlet name (name is something ... These types to map requests to servlets are described in the Java ...
    (comp.lang.java.programmer)