Dola Woolfe wrote:
> Hi,
>
> Within a .jsp document, is there a way of referring to a file in same 
> directory?
>
> For example, new java.io.File(ThisDir, "FileName.txt").
>
> Thanks,
>
> Dola
>
>
>       
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>   
There aren't any API calls to do that directly.  Provided the jsp is
being directly called from the client, you could use
request.getServletPath() to get the path to the jsp and use that to
compute a webapp relative path to the file you want.  Then use something
like pageContext.getServletContext.getResourceAsStream(myfilepath.txt)
to open the file for read.

--David


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to