tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: How to access servlets without prefixes
Date Sat, 23 Dec 2000 16:50:35 GMT
Christian Parpart wrote:

> Hi all
>
> how can I access a servlet wich is
> mapped to any *.xml file without giving him
> any prefix like /mywebapp?
>
>  <servlet>
>   <servlet-name>XmlFilter</servlet-name>
>   <servlet-class>myServlets.xmlFilter.XmlFilter</servlet-class>
>  </servlet>
>  <servlet-mapping>
>   <servlet-name>XmlFilter</servlet-name>
>   <url-pattern>*.xml</url-pattern>
>  </servlet-mapping>
>
> This should be accessable from every sub directory on my host.
>
>  <Host name="www.myhost.org">
>    <Context path=""
>             docBase="C:/path/to/htdocs"
>             debug="0" reloadable="true" trusted="true" >
>    </Context>
>  </Host>
>
> This data is stored in $tomcat/conf/web.xml, because I thought
> these information are available for all hosts defined in server.xml.
>

That was true in Tomcat 3.1 (and 4.0), but was changed in 3.2.  You will need to
put your servlet and servlet-mapping definitions in the WEB-INF/web.xml file for
each application.

>
> But it doesn't work. Why and how should I define it?
>
> Thanks in advance,
>
> Christian Parpart
> SurakWare
> cparpart@surakware.com
> http://www.surakware.com

Craig McClanahan



Mime
View raw message