You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Jacob Lauemøller <Ja...@wise.dk> on 2000/03/30 15:25:17 UTC

Where do I place resources (gifs?)

Hi all

One of my collegues are working on a Tomcat application but has ran into a
problem: where should resources such as gifs etc. be placed? Can you help?

Here's his original question:

I need to know where to put servlet resources like gif’s and resource
budles - preferably I would like to be able to configure where they should
be kept.

I have defined a servelt which will be loaded using
<http://xxx.xxx.xxx.xxx:8080/servlet/Ebit>. Where should a resource, say
figure.gif referenced in the page returned by the servlet be placed for the
server to be able to find it. When I specify /EbitResources/figure.gif then
the browser will try to fetch
http://xxx.xxx.xxx.xxx:8080/EbitResources/figure.gif.

I defined the following context in servlet.xml:

       <Context path="/EBit" docBase="EBitResource"
            defaultSessionTimeOut="30" isWARExpanded="true"
            isWARValidated="false" isInvokerEnabled="true"
            isWorkDirPersistent="false"/>

The web.xml file holds this sole definition :
<web-app>
	<servlet>
		<servlet-name>
			EBit
		</servlet-name>
		<servlet-class>
			dk.wise.eservice.framework.RequestManager
		</servlet-class>
		<load-on-startup>
			-2147483646
		</load-on-startup>
	</servlet>
</web-app>


context question

Posted by Ruslan Makarov <lo...@eltegra.ru>.
Hi all

Today i have got last sources from CVS, built tomcat and tried to run
it as a standalone webserver on NT
I have a context - sc
It is mapped to directory D:\src\build\tomcat\webapps\sc in
server.xml file:

<Context path="/sc" docBase="d:/src/build/tomcat/webapps/sc" debug="0" reloadable="true" >
</Context>

So now i try to call to some jsp in this context - i have sc.jsp in
D:\src\build\tomcat\webapps\sc and put in my browser the next string:
http://mysystem:8080/sc/sc.jsp
then i've got an error - cannot open this URL

In jasper.log i see that tomcat looks for sc.jsp in
D:\src\build\tomcat\webapps\ directory, not in
D:\src\build\tomcat\webapps\sc
----------------------------------------------------------
IMPORTANT: Do not modify the generated servlets</JASPER_LOG>
JspEngine --> /sc.jsp</JASPER_LOG>
ServletPath: /sc.jsp</JASPER_LOG>
PathInfo: null</JASPER_LOG>
RealPath: D:\src\build\tomcat\webapps\sc.jsp</JASPER_LOG>
RequestURI: /sc/sc.jsp</JASPER_LOG>
QueryString: null</JASPER_LOG>
Request Params: </JASPER_LOG>
----------------------------------------------------------

why???

if i create a directory under D:\src\build\tomcat\webapps\sc and put
sc.jsp there then all works fine (for example
D:\src\build\tomcat\webapps\sc\test and sc.jsp there then i'm able to
reach it by http://mysystem:8080/sc/test/sc.jsp)

so the problem concerns jsp files in the context root directory

Is it a bug or my misconfiguration???


Also i would like to catch Catalina purpose - is it a reconstruction
of tomcat and if so then how is it being done? Parallel to base tomcat
developing? Is it independent of existing tomcat classes and is it a
project at all or just a suggestion?


-- 
Best regards,
Ruslan V. Makarov
mailto  : ruslan@gjt.org
PGP KEY : M$_SUXXX



Re: Where do I place resources (gifs?)

Posted by Brill Pappin <br...@jmonkey.com>.
The sort answer is "put them where you like to put them".
Nothing has changed with the HTTP protocol... and a gif is still referenced
the same way it always has been.

Remember that the /servlet/ path is a virtual path, and does not really
exist as a path that html or images can be served from... so GIFs should not
go in your servlets directory. (You could force the issue and set it up so
that your gifs could be in the servlets directory, but that would be on the
messy side.)

- Brill Pappin

----- Original Message -----
From: "Jacob Lauemøller" <Ja...@wise.dk>
To: <to...@jakarta.apache.org>
Cc: "Jesper Zacho" <Je...@wise.dk>
Sent: Thursday, March 30, 2000 8:25 AM
Subject: Where do I place resources (gifs?)


> Hi all
>
> One of my collegues are working on a Tomcat application but has ran into a
> problem: where should resources such as gifs etc. be placed? Can you help?
>
> Here's his original question:
>
> I need to know where to put servlet resources like gif's and resource
> budles - preferably I would like to be able to configure where they should
> be kept.
>
> I have defined a servelt which will be loaded using
> <http://xxx.xxx.xxx.xxx:8080/servlet/Ebit>. Where should a resource, say
> figure.gif referenced in the page returned by the servlet be placed for
the
> server to be able to find it. When I specify /EbitResources/figure.gif
then
> the browser will try to fetch
> http://xxx.xxx.xxx.xxx:8080/EbitResources/figure.gif.
>
> I defined the following context in servlet.xml:
>
>        <Context path="/EBit" docBase="EBitResource"
>             defaultSessionTimeOut="30" isWARExpanded="true"
>             isWARValidated="false" isInvokerEnabled="true"
>             isWorkDirPersistent="false"/>
>
> The web.xml file holds this sole definition :
> <web-app>
> <servlet>
> <servlet-name>
> EBit
> </servlet-name>
> <servlet-class>
> dk.wise.eservice.framework.RequestManager
> </servlet-class>
> <load-on-startup>
> -2147483646
> </load-on-startup>
> </servlet>
> </web-app>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>