Peter:

getRealPath() is a deprecated method, and as such, may not be implemented on
whatever version of JRun you are running.  If you need to get file resources
from within the context, take a look at the methods getResource() and
getResourceAsStream().

This is due to the fact that some servlet containers that support .war file
deployment do not extract the contents of the .war file and this, they have no
"real" path.  From what I understand, the new methods retrieve the resource from
the .war archive directly if one exists.

Someone correct me if this is incorrect or there are other reasons behind this
change.

Hope that helps.


Cheers,

drumshamen

| -----Original Message-----
| From: A mailing list for discussion about Sun Microsystem's Java Servlet
| API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Peter
| Barraud
| Sent: Thursday, August 30, 2001 4:55 AM
| To: [EMAIL PROTECTED]
| Subject: getRealPath() in JRUN
|
|
| Hi,
| Is there anybody there who is using jrun. I want to load a file object using
| a jsp.
| So I have the code
| getServletConfig().getServletContext().getRealPath("app.log")
| now this works perfectly fine in Tomcat but unfortunately when I try to run
| the jsp in JRun then it says:
|
| Error on line 0: File "D:\Program
| Files\Allaire\JRun\servers\default\app\app.log" not found.
| (and I have checked that the file is in the path that has been specified in
| the error)
|
| anybody has any idea why this happens??
| pb
|
| ___________________________________________________________________________
| To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
| of the message "signoff SERVLET-INTEREST".
|
| Archives: http://archives.java.sun.com/archives/servlet-interest.html
| Resources: http://java.sun.com/products/servlet/external-resources.html
| LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
|

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to