tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: Specify one file for all directory mappings
Date Mon, 20 Oct 2003 10:50:36 GMT
A simple way is to extend the default servlet. Then when the default servlet 
is asked to doa  directory listing you can .forward() to your jsp or servlet. 
Otherwise you can call super and keep the default functionality for serving 
images and other static assets.

-Tim

Eric Bessette wrote:
> Is there a way to specify one file, like the one below, for all directory
> mappings?
> 
> file (index.jsp):
> <%@ taglib uri="struts-tiles" prefix="tile" %>
> 
> <tile:insert definition="project.layout.main" flush="true">
>         <tile:put name="sidebar" value="${
> pageContent.request.requestURI }/sidebar.jsp" />
>         <tile:put name="content" value="${
> pageContent.request.requestURI }/content.jsp" />
> </tile:insert>
> 
> The file would be used for all uri's that end with directories, like
> http://host/project/dir1/ and http://host/project/dir1/dir2/.
> 
> I tried using the welcome-file-list in my web.xml to do this, but it looks
> like those files are only relative.
> 
> <welcome-file-list>
> 	<welcome-file>index.jsp</welcome-file>
> 	<welcome-file>/shared/index.jsp</welcome-file>
> 	<welcome-file>index.html</welcome-file>
> </welcome-file-list>
> 
> Is there anyway to configure Tomcat, Struts, or Tiles to do this?


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


Mime
View raw message