> From: Qiao Jin [mailto:bra...@gmail.com]
> Subject: application.getRealPath() in JSP from a subdirectory
>
> I am using Tomcat 6.0.18, JDK 1.5 on CentOS 5. From within a JSP page,
> applicaton.getRealPath() is returning results that I wasn't expecting.

Using getRealPath() inside an app server of any kind is pretty much always a 
Bad Idea.  If you need to access a file from your webapp, use 
ServletContext.getResourceAsStream().  If you need a place to store a file, it 
certainly shouldn't be inside the webapp deployment area, which should be 
treated as read-only.

 - 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

Reply via email to