tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stewart, Robbie (Contractor)" <Robbie.Stew...@dsto.defence.gov.au>
Subject tomcat config for static resources in context (2)
Date Mon, 29 Oct 2001 00:59:38 GMT
G'day all,
Much appreciation for any help to show me how to configure tomcat: a) for my
servlet to service the html resources both  pseudo)-static and dynamic, and
b) for everything else to served by the default  servlet (or whatever it is
within tomcat which serves static resources, as in:

  http://url.com/foo/bar/baz.html ==> foo servlet
  http://url.com/foo/bar/images/baz.gif ==> tomcat
  http://url.com/foo/bar/baz.pdf ==> tomcat

TIA,

Robbe Stewart
Contractor
2.C.64



> -----Original Message-----
> From: Stewart, Robbie (Contractor)
> [mailto:Robbie.Stewart@dsto.defence.gov.au]
> Sent: Tuesday, October 23, 2001 1:17 PM
> To: 'tomcat-user@jakarta.apache.org'
> Subject: tomcat config for static resources in context
> 
> 
> Hi all, a question re: url mapping and static resources
> 
> I have a fairly basic webapp/servlet which uses velocity 
> for building dynamic pages either from content extracted
> from xml data sources, or from static html pages which 
> are wrapped in velocity templates. The webapp is served from 
> tomcat (4.x). 
> 
> Basic out of the box setup for WEB-INF/web.xml was straight
> forward just mapping everything for the particular url pattern 
> to the servlet, as in:
> 
>     <servlet-mapping>
>         <servlet-name>foo</servlet-name>
>         <url-pattern>/foo/*</url-pattern>
>     </servlet-mapping>
> 
> 
> Content providers are now depositing static html with references
> to local (as in within the servlet's context) resources (e.g.,
> images, archives, pdf etc), and the original conf is no longer
> sufficient. My attempts to map specific extensions to the default
> servlet have not worked:
> 
>     <servlet-mapping>
>       <servlet-name>default</servlet-name>
>       <url-pattern>*.pdf</url-pattern>
>     </servlet-mapping>
> 
>     <servlet-mapping>
>       <servlet-name>default</servlet-name>
>       <url-pattern>*.png</url-pattern>
>     </servlet-mapping>
> 
> What I need to have is: a) for my servlet to service the html 
> resources
> both (pseudo)-static and dynamic, and b) for everything else to served
> by the default servlet (or whatever it is within tomcat which serves
> static resources, as in:
> 
>   /foo/bar/baz.html ==> foo servlet
>   /foo/bar/images/baz.gif ==> tomcat
>   /foo/bar/baz.pdf ==> tomcat
> 
> FAQ's and forums I have searched give pointers on how to map complete
> paths to this or that servlet but I have not found anything which 
> says how to map parts of paths to this and parts of paths to that.
> 
> Any help much appreciated.
> 
> Robbe Stewart
> Contractor
> 2.C.64
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message