One more thing - do not forget to tell the App Engine that the files
you want to read by getResourceAsStream() are resource files. Include
the following into your WEB-INF/appengine-web.xml:

  <resource-files>
    <include path="/theme/*.gif" />
  </resource-files>

Vaclav

On Nov 30, 2:31 pm, bysse <erik.byst...@gmail.com> wrote:
> This should get you going:
>
>  InputStream resourceAsStream = getServletContext().getResourceAsStream
> (pathToImage);
>  // use stream to read image data
>  ...
>  resp.setContentType("image/gif");
>  resp.setContentLength(imageData.length);
>  outputStream.write(imageData, 0, imageData.length);
>
> /Erik
>
> On Nov 30, 11:23 am, Prashant <antsh...@gmail.com> wrote:
>
> > Hi,
>
> > I have a servlet with request handler */file/** . I want to return a file *
> > /theme/bg.gif* for all */file/*.gif *. I can check for .gif extension then
> > how do i send */theme/bg.gif*, for */file/*.gif* without sending a redirect
> > ?
>
> > Thanks.

--

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


Reply via email to