ok, I asked webhosting guy, this is what finally worked:
/chroot/home///tomcat/webapps/india/delhi/images
:)
many thanks for yr help...
David Smith wrote:
What I posted was an excerpt from a jsp page writing the index of a
folder -- no Struts in sight. "directory" was just an arbitrary req
What I posted was an excerpt from a jsp page writing the index of a
folder -- no Struts in sight. "directory" was just an arbitrary request
parameter for example purposes:
http://localhost:8080/myWebApp/imageList.jsp?directory=%2fsome%2fdirectory
It doesn't really matter how you get that stri
yes I know, eventually I want to do this whole webapp in struts.. for
now just want to be able to count how many images in 'images' folder..
(what I don't get here is first line.. where does the reqParameter come
from? (this method is usu. used to get params from request (user input,
quer
Ok... I think I'm starting to see the picture here. You want to be able
to write a jsp that can list the directory contents of a folder. This
is very crude, no error checking, untested, etc. but you'll catch on
<%
String reqParameter = request.getParameter( "directory" ) ;
asses-"
{
permission java.security.AllPermission;
};
HTH
Martin --
- Original Message -
From: "maya" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, April 03, 2007 4:42 PM
Subject: Re: accessing files/dirs.
thank you.. someone in another forum said the same thing.. prob
thank you.. someone in another forum said the same thing.. problem is,
if I have trouble accessing directory, how will I tell these methods to
"get Resource" for that dir? :)
(also, alas, don't quite remember how to use methods of interfaces --
since interfaces can't be instantiated, di
I'm not sure what you're attempting to do here, but have you thought
about ServletContext.getResource() and
ServletContext.getResourceAsStream() ? Both are safe methods of reading
resources from the webapp whether it be in a compressed archive or not.
There is also getRealPath(), but it will
File dir = new File("C:\\apache-tomcat-5.5.17\\webapps\\india\\delhi\
\images");
this works fine in my machine locally, but on my website.. if, say,
I'm in dir where 'images' dir is, this doesn't work...
File dir = new File("images")
starting @ root of webapp also doesn't work...
F