Though this is not
jsp, but jhtml the problem is somewhat similar.
Scenario:
1. jhtmls are inside this:
KDCATG/modules/b2b/htdocs/global/en/b2b/private/admin/esrvtool/
2. I access these jhtmls in this way:
<server>:<port>/dyn/dyn/global/en/b2b/private/admin/esrvtool/
<some>.jhtml
3. /dyn is the context root.
4. Now I'm creating text file under a directory:
KDCATG/modules/b2b/htdocs/global/numberfile/
5. I want to download these text files after redirection from a
servlet:
<server>:<port>/dyn/dyn/global/numberfile/<some>.txt
Problem:
If I try to create the file using the relative path like "/dyn/dyn/
global/numberfile/" it cannot find the path, which is normal, there is
no such path. So I had to give the whole path. Now how to create the
file without a path which is not dependent on my own directory
structure, but should be dependent only on the webapp directory
structure.
Similarly, if I want to access as in #5 step, its giving 404: resource
not found. But, atleast here, it should access the directory, but it's
not.
Or, if I just want to see the directory listing in the browser from
<server>:<port>/dyn/dyn/global/
it doesn't show the "numberfile" directory.
So, how I can do it with relative path? Do I need to configure
somewhere?
And ok, I printed the req.getContextPath() --> /dyn
and
req.getRealPath(req.getContextPath()) --> null
[ December 11, 2008: Message edited by: Bear Bibeault ]