On 23/11/2009 18:41, Ludwig Magnusson wrote:
Thank you, that one worked.
/Ludwig

May I ask what you're searching for?


p

-----Original Message-----
From: Joseph Morgan [mailto:joseph.mor...@ignitesales.com]
Sent: den 23 november 2009 19:25
To: Tomcat Users List
Subject: RE: Problems finding the right filepath

Ludwig, it's been a while, but there used to be a function "getRealPath"
or something very close to that on the ServletContext object where you
can get a system-proper path of a resource.  Have you tried that?

-----Original Message-----
From: Ludwig Magnusson [mailto:lud...@itcatapult.com]
Sent: Monday, November 23, 2009 12:17 PM
To: 'Tomcat Users List'
Subject: RE: Problems finding the right filepath

We are running Tomcat 6.0.20.
The JDK is 1.6 but not the exact same version on all machines. My
computer
has 1.6.0.17, the server has 1.6.0.07
We are developing on both windows and mac. The server is ubuntu.

To specify what I want, here is a model of my filesystem:

/Tomcat-folder
    /conf
    /webapps
      /my-webapp
        /WEB-INF
           /web.xml
        /my-folder<--- this is the folder I want to search

If there is no specific way of solving this I can try the ones you have
suggested.
/Ludwig

-----Original Message-----
From: Joseph Morgan [mailto:joseph.mor...@ignitesales.com]
Sent: den 23 november 2009 19:02
To: Tomcat Users List
Subject: RE: Problems finding the right filepath

Or... maybe within a initialization parameter for a servlet if you are
using Java

-----Original Message-----
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
Sent: Monday, November 23, 2009 11:59 AM
To: Tomcat Users List
Subject: RE: Problems finding the right filepath

From: Ludwig Magnusson [mailto:lud...@itcatapult.com]
Subject: Problems finding the right filepath

We are a team developing a webapp running on a tomcat server.

What version of Tomcat?  (Be precise.)  What JVM?

We need to list the files in a certain directory in our
application, but we cannot find a way to always get the
correct path on the different platforms and environments.

Can you let the DefaultServlet do it?  Directory listings are normally
disabled, but you can enable them for your particular webapp if you wish

Note that there is no requirement for a servlet container (e.g., Tomcat)
to provide *any* access to the underlying file system (if there is one
at all), other than to a scratch area for the webapp's internal use.  If
your webapp is deployed as a .war file, there is no file structure to
look at.

Is this solvable through some IO-function or do we need
to specify the path to our project in each environment?

You will likely need to specify the path through an environment
variable, Java system property, or within the webapp<Context>  element,
via a nested<Parameter>  or<Environment>  setting.

  - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to