tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnny Kewl" <j...@kewlstuff.co.za>
Subject Re: Static files outside container
Date Mon, 26 May 2008 21:49:36 GMT

----- Original Message ----- 
From: "Mathias P.W Nilsson" <mathias@snyltarna.se>
To: <users@tomcat.apache.org>
Sent: Monday, May 26, 2008 3:21 PM
Subject: Static files outside container


>
> Hi!
>
> I'm using tomcat as a container for my wicket application. To keep my 
> files
> when deploying I have my files outside the container.
>
> Wicket does not have support for static files out side the container so I
> have a servlet that handles the request. Problem is that There is multiple
> selects from the database with this solution.
>
> I would like a way of checking the path /Files/ and if this occures fetch
> the file from a different path. I know this is possible but just not how. 
> I
> have looked at the DefaultServlet for tomcat. Is this the way of doing 
> this?

If you asking how to read a file, for that check out Suns Java tutorial ;)
Too many options to cover here, they teach it better
    File f = new File("/da/folder");
    if (f.exists())  blah blah

If you trying to find yourself... try this and you'll get the idea
        ServletContext context = getServletContext();
        String sWebBase = context.getRealPath("/");

If you looking for a good place to stick your files, check out
    String user_home = System.getProperty("user.home");
and theres more useful java properties


Have fun

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


Mime
View raw message