Hello,

For context = getContext("/a/b/c.html"), the path
being user-entered,

how do I know, if the Context is the Root context
containing /a/b/c.html
or if the Context is /a containing /b/c.html?

The difference is important because to get the real
path of c.html in the former case I'd have to
getRealPath("/a/b/c.html") and in the latter case
getRealPath("/b/c.html")

As I understand the ServletContext#getRealPath() API
doc, you need a path relativ to the context as
parameter. At least this is suggested by the example
given and so Tomcat 5 works.

I could check if getResourcePaths("/") contains /a/ 
but what if b also contains an a subfolder?

A hack might be to context.getResource("/")
.toString() and take the last path component, this
might be the context name, but I wonder, if this will
always work?

Thank you very much,
J�rgen

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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

Reply via email to