Incidentally, although it was in another thread, it was related, my question about getting the URL in a plug-in. I wasn't able to find a way to do it, but I did find that I only actually had two places in all my classes that would have been effected, so I just constructed the URL like so:
String path = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();
I'm pretty sure everyone knew that already, but just in case anyone needs the info, there it is. But, if anyone can figure out how to get the equivalent final String as the above code without using the Request object (i.e., so it'll work from a plug-in), I'd be interested to hear how.
Frank
From: Venkat Maddipati <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: 'Struts Users Mailing List' <[EMAIL PROTECTED]> Subject: RE: ServletContext in Action Date: Tue, 8 Jun 2004 10:07:05 -0700
Frank,
You can also use the following, if you want:
this.servlet.getServletContext();
Thanks, Venkat
-----Original Message----- From: Frank Zammetti [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 08, 2004 7:37 AM To: [EMAIL PROTECTED] Subject: ServletContext in Action
Can anyone see how to get access to the current ServletContext object from within an Action? I might be missing something obvious, but I don't see a way to do it. Specifically I need to get the real filesystem path to my WEB-INF folder... I have code that does this already, but it requires the ServletContext. Is there another way that I'm not aware of? Thanks all!
Frank
_________________________________________________________________ Watch the online reality show Mixed Messages with a friend and enter to win a trip to NY http://www.msnmessenger-download.click-url.com/go/onm00200497ave/direct/01/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
************************************************************************
If you have received this e-mail in error, please delete it and notify the sender as soon as possible. The contents of this e-mail may be confidential and the unauthorized use, copying, or dissemination of it and any attachments to it, is prohibited.
Internet communications are not secure and Hyperion does not, therefore, accept legal responsibility for the contents of this message nor for any damage caused by viruses. The views expressed here do not necessarily represent those of Hyperion.
For more information about Hyperion, please visit our Web site at www.hyperion.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]