Re: a jsp question:how to get the web application's directory?

2003-06-14 Thread Rob
I prefer html:base/ for this.

lcl wrote:
Hi all,

I just have a question about jsp/servlet, how to gain the directory  in the
file system of a web application? because I want to create a file under the
web application, and redirect it to user.
Best Regards
lcl


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



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


a jsp question:how to get the web application's directory?

2003-06-12 Thread lcl
Hi all,

I just have a question about jsp/servlet, how to gain the directory  in the
file system of a web application? because I want to create a file under the
web application, and redirect it to user.

Best Regards
lcl




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



Re: a jsp question:how to get the web application's directory?

2003-06-12 Thread Dan Tran
Cant you just create a stream on the fly and ship it back to the user thru
HTTPResponse?

In you insist on writting to a webapp directory, look up
getRealPath().

-Dan
- Original Message - 
From: lcl [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 7:41 PM
Subject: a jsp question:how to get the web application's directory?


 Hi all,

 I just have a question about jsp/servlet, how to gain the directory  in
the
 file system of a web application? because I want to create a file under
the
 web application, and redirect it to user.

 Best Regards
 lcl




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



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



Re: a jsp question:how to get the web application's directory?

2003-06-12 Thread lcl
OutputStream, seemed very good, but could you give me a more detailed
infomation, because I have touch it before, thank you very much.

Dan Tran [EMAIL PROTECTED] [EMAIL PROTECTED]
 Cant you just create a stream on the fly and ship it back to the user thru
 HTTPResponse?

 In you insist on writting to a webapp directory, look up
 getRealPath().

 -Dan
 - Original Message -
 From: lcl [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, June 12, 2003 7:41 PM
 Subject: a jsp question:how to get the web application's directory?


  Hi all,
 
  I just have a question about jsp/servlet, how to gain the directory  in
 the
  file system of a web application? because I want to create a file under
 the
  web application, and redirect it to user.
 
  Best Regards
  lcl
 
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 




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



RE: a jsp question:how to get the web application's directory?

2003-06-12 Thread Nimish Chourey , Tidel Park - Chennai
Try this ..

ClassLoader classLoader =
Thread.currentThread().getContextClassLoader();
InputStream is =
classLoader.getResourceAsStream(foo.txt);

This will load the file from the webapps classpath ie from WEB-INF ...

here foo.txt is in WEB-INF/classes.

 



-Original Message-
From: lcl [mailto:[EMAIL PROTECTED]
Sent: Friday, June 13, 2003 8:54 AM
To: [EMAIL PROTECTED]
Subject: Re: a jsp question:how to get the web application's directory?


OutputStream, seemed very good, but could you give me a more detailed
infomation, because I have touch it before, thank you very much.

Dan Tran [EMAIL PROTECTED] [EMAIL PROTECTED]
 Cant you just create a stream on the fly and ship it back to the user thru
 HTTPResponse?

 In you insist on writting to a webapp directory, look up
 getRealPath().

 -Dan
 - Original Message -
 From: lcl [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, June 12, 2003 7:41 PM
 Subject: a jsp question:how to get the web application's directory?


  Hi all,
 
  I just have a question about jsp/servlet, how to gain the directory  in
 the
  file system of a web application? because I want to create a file under
 the
  web application, and redirect it to user.
 
  Best Regards
  lcl
 
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 




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