tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: Virtual Paths and Tomcat?
Date Sat, 30 Mar 2002 20:23:57 GMT
In your web.xml, just add the following mapping:

<servlet>
         <servlet-name>mlservlet</servlet-name>
         <servlet-class>MediaLibrary</servlet-class>
     </servlet>
<servlet-mapping>
         <servlet-name>mlservlet</servlet-name>
         <url-pattern>/servlets/medialibrary/*</url-pattern>
</servlet-mapping>

That should do it.  Now a call to any path starting with 
/servlets/medialibrary will call the MediaLibrary servlet and the rest such 
as "/audio/groupx/box.m3u" will be treated as pathInfo ( req.getPathInfo() 
) for that servlet.


Jake

At 11:36 AM 3/30/2002 -0500, you wrote:
>Hi,
>
>  I have recently decided to make the move from JServ to Tomcat and one
>of my servlets is having problems with the transition. The issue arises
>because I make use of a virtual path which I add onto the of the servlet
>path, as in the example:
>
>  servlet path:  http://bob.com/servlets/medialibrary
>  resulting url: http://bob.com/servlets/medialibrary/audio/groupx/box.m3u
>
>This approach works with JServ but Tomcat can't seem to handle it. For
>the basic servlet path Tomcat serves runs the servlet without a hitch,
>but as soon as I add the extended path I get a error of the form 'resource
>not found'. Is there any way I can get this working with Tomcat? I don't
>want to have to resort to a variable parameter as this would mean that the
>user will be given the name of the servlet for download, as opposed to the
>generated file name.
>
>Thanks
>
>Andre
>
>--
>mailto:ajmas@bigfoot.com
>
>
>--
>To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
>Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message