jQuery in Action, 3rd edition
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

Win a copy of Building Microservices this week in the Design forum!
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

2. Upload.java
(The MultipartMap servlet belongs to BalusC, http://balusc.blogspot.com.au/2009/12/uploading-files-in-servlet-30.html)

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Problem with image displaying in jsp page.
jQuery in Action, 3rd edition