If you ned the path for the WEB-INF, - use a servlet, - which is loaded
before the struts, by configuring it in the WEB.XML.

In the servlet you execute...
public static String directory =
getServletContext().getRealPath("conf");

This returns the physical location of the WEB-INF. You get the location
from the action classes by accessing the servlet' static variable.

Geir



-----Opprinnelig melding-----
Fra: Simon Kelly [mailto:[EMAIL PROTECTED]] 
Sendt: 10. januar 2003 15:24
Til: Struts Users Mailing List
Emne: Getting the full path of the context from within an Action class


Hi,

Which would be the better and more portable solution for getting the
actual path of the API context from within a
org.apache.struts.action.Action class?

I am looking at either using
mapping.getPath()
or
request.getContextPath()

Are either of these going to give me an absolute (ie
C:\xxx\yyy\WEB-INF\) path to the context on the local machine?  Or will
it be a relative URL?

Cheers

Simon

Institut fuer
Prozessdatenverarbeitung
und Elektronik,
Forschungszentrum Karlsruhe GmbH,
Postfach 3640,
D-76021 Karlsruhe,
Germany.

Tel: (+49)/7247 82-4042
E-mail : [EMAIL PROTECTED]


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


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

Reply via email to