You need to get the real path using the ServletContext. For example, to get
your WEB-INF:

getServletContext().getRealPath("/WEB-INF/")

Stephen

On Tue, Mar 8, 2011 at 9:34 PM, Nguyen Trung Kien
<kiennguyen....@gmail.com>wrote:

> Hi all,
> I've read old discussion but i can not find out what happened to my
> project.
> I want to read an .txt from a servlet from my java project. Like
>
> BufferedReader in = new BufferedReader(
>                    new InputStreamReader(
>                    new FileInputStream("data/cafe.txt"), "UTF8"));
>
> with appengine-web.xml like this
>
>    <static-files>
>        <include path="/data/cafe.txt"/>
>    </static-files>
>
> and my cafe.txt file is put under Web-INF/data/
>
> but when my program run, the error "file not found " is raised?
> So where is the problem with my project??
> Thank you all,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to google-appengine@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to