I'm not sure you can access WEB-INF from the Servlet Context? I thought it
wasn't served to the client, so wouldn't for example be hanging off the root
of the servlet context (which '/WEB-INF/') basically means.

-----Original Message-----
From: Ronald Wildenberg [mailto:[EMAIL PROTECTED]]
Sent: 13 June 2002 12:24
To: [EMAIL PROTECTED]
Subject: [Fwd: Re: getResourceAsStream(java.lang.String path)]




-------- Original Message --------

Subject:         Re: getResourceAsStream(java.lang.String path)
Date:    Thu, 13 Jun 2002 16:34:51 +0530
From:    [EMAIL PROTECTED]
To:      [EMAIL PROTECTED]



But still iam getting the same result


Is there any wrong in my code ?


                        InputStream in =
context.getResourceAsStream("/WEB-INF/Test.txt");
                        InputStreamReader ir = new
InputStreamReader(in,US-ASCII);
                        while((ch = ir.read())!= -1)
                                System.out.print(ch);


----- Forwarded by Jwas J/IBS on 06/13/02 04:27 PM -----

        Ronald Wildenberg <[EMAIL PROTECTED]>
Sent by: "A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology." <[EMAIL PROTECTED]>


06/13/02 03:33 PM
Please respond to "A mailing list for discussion about Sun Microsystem's
Java Servlet API Technology."


        To:        [EMAIL PROTECTED]
        cc:
        Subject:        Re: getResourceAsStream(java.lang.String path)



You can get a character stream (= Reader) by using
java.io.InputStreamReader.


Ronald.



"[Jwas J]" wrote:
Hello


Can anyone tell me where is "getResourceAsStream(java.lang.String path)" is
used .


We only get byte stream right ? Is there any way to get character stream.


Regards
Jwas

This e-mail is confidential and intended only for the addressee(s) shown.
If you are not an intended recipient, please be advised that any use,
dissemination, forwarding or copying of this e-mail is strictly prohibited.
Internet e-mails are not necessarily secure and the AXA Group does not
accept responsibility for changes made to this message after it was sent.
Please note that incoming and outgoing electronic mail messages may be
monitored. Should you receive this transmission in error, notify the sender
immediately.  Thank you

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to