File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Problem with image displaying in jsp page. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem with image displaying in jsp page." Watch "Problem with image displaying in jsp page." New topic

Problem with image displaying in jsp page.

Thomas Byrne

Joined: Aug 21, 2012
Posts: 16

Hi fellows,

I'm a bit lost with following scenario:

1. user upload image - upload.jsp
2. servlet do all dirty job
2a. save image to disk
2b. get name of the file
2c. save the name in session
2d. and redirect to display.jsp)
3. on the display.jsp, just uploaded image should be presented.

Unfortunately the display.jsp page is empty. When I look at source page under firefox, everything seems to be fine, valid link to the image is provided.

But under Media info I can see some weird infos:

Here is code used for uploading, processing and displaying picture:
1. upload.jsp

(The MultipartMap servlet belongs to BalusC,

3. display.jsp

If I replace, in display.jsp, ${filename} with static name of the particular image uploaded before, there is no problem with displaying so I suppose the images are processed correctly just something is missing on forward side?

By the way: when debugger is active everything is OK but when switch off the problem is back.

I agree. Here's the link:
subject: Problem with image displaying in jsp page.
It's not a secret anymore!