Hi,

>Problem is   ServletContext#getRealPath returns null if the webapp
>doesn't get expanded, is what I've had problems with in the past.

Yup, that's why I said IF your webapp is expanded.  His design in this
area is already bad, so this isn't a stretch.

The approach of relative location to $CATALINA_HOME/bin in unsafe in a
variety of situations, including invocation via cron or a startup RC
script, or a change in the tomcat launch scripts which can happen with
any release.  At least the getRealPath approach is OK across tomcat
releases and many other servers, as long as the webapp is expanded.

Yoav Shapira

>-----Original Message-----
>From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
>Sent: Thursday, March 18, 2004 11:19 AM
>To: Tomcat Users List
>Subject: RE: Location of "webapp" directory
>
>
>Hi,
>IF your webapp is expanded, use ServletContext#getRealPath.  Don't rely
>on this relative to $CATALINA_HOME/bin approach.
>
>Yoav Shapira
>Millennium Research Informatics
>
>
>>-----Original Message-----
>>From: D'Alessandro, Arthur [mailto:[EMAIL PROTECTED]
>>Sent: Thursday, March 18, 2004 11:15 AM
>>To: Tomcat Users List
>>Subject: RE: Location of "webapp" directory
>>
>>IF (and this is a big IF) your webapp is expanded, your relative path
>>then becomes from the catalina bin directory, so
>>
>>../webapps/webappname/otherpath
>>
>>Should work, but it's, I've had succes and failures doing this.
>>
>>-----Original Message-----
>>From: Jonathan Melhuish [mailto:[EMAIL PROTECTED]
>>Sent: Thursday, March 18, 2004 11:16 AM
>>To: Tomcat Users List
>>Subject: Location of "webapp" directory
>>
>>The JSP files for my web application are located within a subdirectory
>>of the Tomcat "webapps" directory.  Is there any way to read the
>>filesystem location of this subdirectory from within a JSP page?
>>
>>I would have thought this would be easy, but I haven't managed to find
>>anything that does this :-(
>>
>>TIA,
>>
>>Jon
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>This e-mail, including any attachments, is a confidential business
>communication, and may contain information that is confidential,
>proprietary and/or privileged.  This e-mail is intended only for the
>individual(s) to whom it is addressed, and may not be saved, copied,
>printed, disclosed or used by anyone else.  If you are not the(an)
>intended recipient, please immediately delete this e-mail from your
>computer system and notify the sender.  Thank you.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to