Re: Quick Servlet Question
Try this, File myFile = new File(yourServletName); String myPath = theFile.getAbsolutPath(); Hong Brandon Cruz wrote: Is there a way to use the request object or anything else to get the real path to a folder that the servlet resides in? I want it to return a string like... /usr/local/apache/vhosts/myhost.com/httpdocs Have been looking with no luck and know that someone on this list can tell me if this is possible or not. Thanks! Brandon -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Quick Servlet Question
Exactly, but that method seems to be deprecated. -Original Message- From: DONNIE HALE [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 29, 2001 3:26 PM To: [EMAIL PROTECTED] Subject: Re: Quick Servlet Question You mean like: HttpServletRequest.getRealPath(/); Donnie [EMAIL PROTECTED] 11/29/01 04:06PM Is there a way to use the request object or anything else to get the real path to a folder that the servlet resides in? I want it to return a string like... /usr/local/apache/vhosts/myhost.com/httpdocs Have been looking with no luck and know that someone on this list can tell me if this is possible or not. Thanks! Brandon -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Quick Servlet Question
try javax.servlet.ServletContext.getRealPath(/) Carsten -Original Message- From: Brandon Cruz [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 29, 2001 4:32 PM To: Tomcat Users List Subject: RE: Quick Servlet Question Exactly, but that method seems to be deprecated. -Original Message- From: DONNIE HALE [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 29, 2001 3:26 PM To: [EMAIL PROTECTED] Subject: Re: Quick Servlet Question You mean like: HttpServletRequest.getRealPath(/); Donnie [EMAIL PROTECTED] 11/29/01 04:06PM Is there a way to use the request object or anything else to get the real path to a folder that the servlet resides in? I want it to return a string like... /usr/local/apache/vhosts/myhost.com/httpdocs Have been looking with no luck and know that someone on this list can tell me if this is possible or not. Thanks! Brandon -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Quick Servlet Question
What about ServletContext.getRealPath()? On Thu, 2001-11-29 at 16:31, Brandon Cruz wrote: Exactly, but that method seems to be deprecated. -Original Message- From: DONNIE HALE [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 29, 2001 3:26 PM To: [EMAIL PROTECTED] Subject: Re: Quick Servlet Question You mean like: HttpServletRequest.getRealPath(/); Donnie [EMAIL PROTECTED] 11/29/01 04:06PM Is there a way to use the request object or anything else to get the real path to a folder that the servlet resides in? I want it to return a string like... /usr/local/apache/vhosts/myhost.com/httpdocs Have been looking with no luck and know that someone on this list can tell me if this is possible or not. Thanks! Brandon -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Quick Servlet Question
- Original Message - From: Brandon Cruz [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 4:06 PM Subject: Quick Servlet Question Is there a way to use the request object or anything else to get the real path to a folder that the servlet resides in? I want it to return a string like... /usr/local/apache/vhosts/myhost.com/httpdocs Have been looking with no luck and know that someone on this list can tell me if this is possible or not. Thanks! Brandon [...] good email for you :-) for getRealPath: http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg32185.html http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg13816.html if your purpose for your getting path is only for getting resource: http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg28724.html Bo Nov.29, 2001 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Quick Servlet Question
ive found the ResourceBundle class to be easier to use than an istream approach for getting properties. matt - Original Message - From: Bo Xu [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 5:28 PM Subject: Re: Quick Servlet Question - Original Message - From: Brandon Cruz [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 4:06 PM Subject: Quick Servlet Question Is there a way to use the request object or anything else to get the real path to a folder that the servlet resides in? I want it to return a string like... /usr/local/apache/vhosts/myhost.com/httpdocs Have been looking with no luck and know that someone on this list can tell me if this is possible or not. Thanks! Brandon [...] good email for you :-) for getRealPath: http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg32185.html http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg13816.html if your purpose for your getting path is only for getting resource: http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg28724.html Bo Nov.29, 2001 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]