tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donie Kelly <donie.ke...@tecnomen.ie>
Subject RE: Problem loading images when servlet mapping used
Date Mon, 18 Feb 2002 12:09:03 GMT
Hi Anton

I tried that but got the following error...

ERROR reading java.io.FileInputStream@238a47
At Line 46 /web-app/servlet/

BTW, that the line number in web.xml where I put the snippets in as shown
below. 

Thanks
Donie



-----Original Message-----
From: Anton Brazhnyk [mailto:a.brazhnyk@biconsulting.ws]
Sent: 18 February 2002 11:13
To: Tomcat Users List
Subject: RE: Problem loading images when servlet mapping used

Hi,

> -----Original Message-----
> From: Donie Kelly [mailto:donie.kelly@tecnomen.ie]
> Sent: Monday, February 18, 2002 12:44 PM
> To: 'Tomcat Users List'
> Subject: Problem loading images when servlet mapping used
>
>
> Hi all
>
> I have a mapping in web.xml that looks like
>
>   <servlet-mapping>
>         <servlet-name>mmsProxy</servlet-name>
>         <url-pattern>/</url-pattern>
>   </servlet-mapping>
>
> This is so that I can use a URL like http://host/mms/36123123
>
> The servlet it's mapped to can then get the ID from the path. Simple and
> working fine :)
>
> My problem is that I have a JSP pages in the context also which
> have images.
> The url for the image would be http://host/mms/images/logo.gif
>
> Problem here is that the URL is not mapped and the default mapping from
> above is forcing the request into my servlet. How can I set up a mapping
> without removing the one above which directs all picture requests to
> /mms/images and retrieves the right image
>
>

I didn't try but IMO it should work:

  <servlet>
    <servlet-name>default</servlet-name>
 
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
    <init-param>
      <param-name>debug</param-name>
      <param-value>0</param-value>
    </init-param>
    <init-param>
      <param-name>listings</param-name>
      <param-value>true</param-value>
    </init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>/images/*</url-pattern>
  </servlet-mapping>


>
> Thanks for the help
> Donie
>

Anton

--
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>

--
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
View raw message