web.xml help - pulling images from the war under Apache
From: Scott Ellsworth (scott_at_alodar.com)
Date: 09/30/04
- Next message: Joseph Daniel Zukiger: "Re: Division by zero: float vs. int"
- Previous message: Joseph Daniel Zukiger: "Re: Division by zero: float vs. int"
- Next in thread: Scott Ellsworth: "Re: web.xml help - pulling images from the war under Apache"
- Reply: Scott Ellsworth: "Re: web.xml help - pulling images from the war under Apache"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 29 Sep 2004 21:46:41 -0700
Hi, all.
I would like my webapp to pull images from the war/exploded deployment
directory, rather than having Apache try to snag them from the
filesystem. I have not figured out what to put in web.xml to make that
happen, and I have been experimenting, reading docs, and googling all
day. Anyone want to loan me a clue?
The webapp is to go under Tomcat 4.1.29/Apache 1.3.?. On both the
XServe and the Solaris machines that are going to be the hosts for this,
Apache is set to use mod_jk to forward requests to Tomcat.
When I tried the following web.xml, images appeared happily in if I
connected directly to Tomcat on port 9006. No images appeared if I
connected to Apache on port 80. The compiled jsps did appear.
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>MyMonomer</display-name>
<description>mymonomer</description>
<servlet>
<servlet-name>mymonomer</servlet-name>
<jsp-file>/index.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>mymonomer</servlet-name>
<url-pattern>/*.gif</url-pattern>
</servlet-mapping>
</web-app>
I would have thought my url-pattern would have given me all gifs.
I tried the following servlet mapping, but no images were displayed even
in Tomcat on 9006.
<servlet-mapping>
<servlet-name>mymonomer</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
when I tried an url pattern of
<servlet-mapping>
<servlet-name>mymonomer</servlet-name>
<url-pattern>*</url-pattern>
</servlet-mapping>
Tomcat 4.1.29 started throwing exceptions.
NB: httpd.conf contains
<IfModule mod_jk.c>
JKWorkersFile /etc/httpd/workers.properties
JKLogFile /var/log/httpd/mod_jk.log
JKLogLevel error
JKMount /*.jsp JBoss1
JKMount /servlet/* JBoss1
JKMount /examples/* JBoss1
</IfModule>
in httpd.conf. jk.properties contains no content. server.xml contains
the usual defaults.
Scott
- Next message: Joseph Daniel Zukiger: "Re: Division by zero: float vs. int"
- Previous message: Joseph Daniel Zukiger: "Re: Division by zero: float vs. int"
- Next in thread: Scott Ellsworth: "Re: web.xml help - pulling images from the war under Apache"
- Reply: Scott Ellsworth: "Re: web.xml help - pulling images from the war under Apache"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|