tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J. Ryan Earl" <r...@dynaconnections.com>
Subject RE: Need help exporting contexts not under webapps/
Date Tue, 19 Apr 2005 17:56:15 GMT
Thanks for the reply, I actually figured it a few hours later.  I was trying
to do 2/ in your list.  I added a PICS.xml and a DOCS.xml under the
${CATALINA_HOME}/conf/Catalina/localhost/ directory which gave me the PICS
and DOCS contexts.  ie:

[tomcat@ws06 localhost]$ pwd
/home/tomcat/jakarta-tomcat-5.5.9/conf/Catalina/localhost
[tomcat@ws06 localhost]$ ls
DOCS.xml  host-manager.xml  manager.xml  PICS.xml
[tomcat@ws06 localhost]$ cat PICS.xml
<Context docBase="/mnt/CMFiles/PICS"
         privileged="true" antiResourceLocking="false"
antiJARLocking="false">
</Context>
[tomcat@ws06 localhost]$ cat PICS.xml
<Context docBase="/mnt/CMFiles/PICS"
         privileged="true" antiResourceLocking="false"
antiJARLocking="false">
</Context>
[tomcat@ws06 localhost]$ cat PICS.xml DOCS.xml
<Context docBase="/mnt/CMFiles/PICS"
         privileged="true" antiResourceLocking="false"
antiJARLocking="false">
</Context>
<Context docBase="/mnt/CMFiles/DOCS"
         privileged="true" antiResourceLocking="false"
antiJARLocking="false">
</Context>



-----Original Message-----
From: QM [mailto:qm300@brandxdev.net]
Sent: Monday, April 18, 2005 8:30 PM
To: Tomcat Users List
Subject: Re: Need help exporting contexts not under webapps/


On Mon, Apr 18, 2005 at 01:16:04PM -0500, J. Ryan Earl wrote:
: So my question is, in short, given a directory structure of static files,
: how do you get Tomcat to serve said static content off of an arbitrary
URI?

So, are you trying to
1/ have a Tomcat-run webapp serve content that exists outside of the
context path?

2/ setup the static content as its own webapp (context)?


For #1, the (portable, spec-friendly) way is to write a servlet or
filter to intercept requests for a given URI, open the matching file as
an InputStream, and push the data to the client via the Response
OutputStream.

For #2, I don't remember the exact syntax off the top of my head so I
won't waste your time with something that may not work. =) But it's
definitely possible for a webapp to not exist under the "webapps/"
directory.

Just make sure said webapp has a WEB-INF directory and a web.xml.  Even
a web.xml of just
	<web-app/>
should do.

-QM

--

software   -- http://www.brandxdev.net/
tech news  -- http://www.RoarNetworX.com/
code scan  -- http://www.JxRef.org/

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


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