You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Mathias P.W Nilsson" <ma...@snyltarna.se> on 2008/09/01 22:26:48 UTC

Tomcat 6 and images

Hi!

I'm using tomcat with wicket framework for my webapplication. My images,
css, flashes resides outside the container and therefor I'm using a Servlet
to serve the files.

Is there any builtin function to get files outside the container?
-- 
View this message in context: http://www.nabble.com/Tomcat-6-and-images-tp19260262p19260262.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6 and images

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Hi Martin,
Listen just thought I tell you that your email (mailing list stuff) is 
coming out as one long
line of unpunctuated text... on Outlook anyway.

Its not easy to read it...
---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
--------------------------------------------------------------------------- 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat 6 and images

Posted by Martin Gainty <mg...@hotmail.com>.
static images,css and flash are normally served by apache http://httpd.apache.org/could you explain specifically what you want to serve inside TC and why you prefer to serve <static> resources in a container vs Apache http<d> webserver?Martin ______________________________________________ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. > Date: Mon, 1 Sep 2008 13:26:48 -0700> From: mathias@snyltarna.se> To: users@tomcat.apache.org> Subject: Tomcat 6 and images> > > Hi!> > I'm using tomcat with wicket framework for my webapplication. My images,> css, flashes resides outside the container and therefor I'm using a Servlet> to serve the files.> > Is there any builtin function to get files outside the container?> -- > View this message in context: http://www.nabble.com/Tomcat-6-and-images-tp19260262p19260262.html> Sent from the Tomcat - User mailing list archive at Nabble.com.> > > ---------------------------------------------------------------------> To start a new topic, e-mail: users@tomcat.apache.org> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org> For additional commands, e-mail: users-help@tomcat.apache.org> 
_________________________________________________________________
Get thousands of games on your PC, your mobile phone, and the web with Windows®.
http://clk.atdmt.com/MRT/go/108588800/direct/01/

Re: Tomcat 6 and images

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
----- Original Message ----- 
From: "Mathias P.W Nilsson" <ma...@snyltarna.se>
To: <us...@tomcat.apache.org>
Sent: Monday, September 01, 2008 10:26 PM
Subject: Tomcat 6 and images


>
> Hi!
>
> I'm using tomcat with wicket framework for my webapplication. My images,
> css, flashes resides outside the container and therefor I'm using a 
> Servlet
> to serve the files.
>
> Is there any builtin function to get files outside the container?

It always depends on exactly what you up to, how you deploy etc...
But yes... one way is to...

Set the (read up on context stuff) the docbase to an external folder ...
So you have a webapp that works outside of /webapps
Then in your webapp proper... you just adress the URI of that webapps for 
images.

If you decide later to put the images on say Apache... no problem, same 
idea.

So you dont really have to write a servlet to do it... although if well 
done, its nice having that as well.
The browser comes back for images... so just about anything is possible.
---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat 6 and images

Posted by "Mathias P.W Nilsson" <ma...@snyltarna.se>.
Thank you very much it works perfectly and I got rid of my servlets :)
-- 
View this message in context: http://www.nabble.com/Tomcat-6-and-images-tp19260262p19282295.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6 and images

Posted by Mark Thomas <ma...@apache.org>.
Mathias P.W Nilsson wrote:
> Can this be hacked? like http://localhost/files/../../somefile

No. There have been some recent vulnerabilities with particular
configurations in this area but these are fixed in the latest 5.5.x and
6.0.x releases.

Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat 6 and images

Posted by "Mathias P.W Nilsson" <ma...@snyltarna.se>.
Can this be hacked? like http://localhost/files/../../somefile
-- 
View this message in context: http://www.nabble.com/Tomcat-6-and-images-tp19260262p19379214.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat 6 and images

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mathias P.W Nilsson [mailto:mathias@snyltarna.se]
> Subject: Re: Tomcat 6 and images
>
> How can I fit the images into this beacuse I don't quite follow.

Do what Filip suggested; create a <Context> element in conf/Catalina/localhost/images.xml with this value:

<Context docBase="/absolute/path/to/images"/>

This creates another webapp named "images" (specified by the name of the .xml file) located outside of Tomcat's directory tree.  Point your static content URLs to /images/[filename.type] to have Tomcat's DefaultServlet deliver them.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6 and images

Posted by "Mathias P.W Nilsson" <ma...@snyltarna.se>.
Thanks!

I'm currently deploying using ROOT.war. Here is the server.xml content.

How can I fit the images into this beacuse I don't quite follow.

<Engine name="Catalina" defaultHost="localhost">
  <Host name="localhost"  appBase="webapps"
   unpackWARs="true" autoDeploy="true"
   xmlValidation="false" xmlNamespaceAware="false">
     <Alias>myhost</Alias>
  </Host>
</Engine>
-- 
View this message in context: http://www.nabble.com/Tomcat-6-and-images-tp19260262p19280777.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6 and images

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
sure there is,

you can deploy it by using a context

<Context docBase="/path/to/static-resources" path="/images"/>

Filip

Mathias P.W Nilsson wrote:
> Hi!
>
> I'm using tomcat with wicket framework for my webapplication. My images,
> css, flashes resides outside the container and therefor I'm using a Servlet
> to serve the files.
>
> Is there any builtin function to get files outside the container?
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org