Bear Bibeault wrote:Are you setting the content headers on the response correctly? Is the image data correct?
Likely easier to debug if you just type the URL for the image into the browser's address bar.
Use the browser tools to inspect the response for correctness.
Bear Bibeault wrote:That URL does not match the pattern you specified in the deployment descriptor.
Bear Bibeault wrote:You need to prefix the url to the image with the context path. Use: ${pageContext.request.contextPath}
Bear Bibeault wrote:
ksh agarwal wrote:And i am calling it from jsp like this
<img />
Be sure to disable HTML when you post HTML code or your image tags will be empty.
Please repost with the real code.
Bear Bibeault wrote:
ksh agarwal wrote:And i am calling it from jsp like this
<img />
Be sure to disable HTML when you post HTML code or your image tags will be empty.
Please repost with the real code.
Bear Bibeault wrote:The URL for the <img> tag needs to be to a servlet that sends the image data. Having the image blob in the JSP is not useful. Remember, JSP just creates HTML. When you write the page in HTML do you give the image tag a blob of data? No. You give it the URL of the image.
Stefan Evans wrote:Specifically the flush="true" attribute is flushing the buffer, and committing the response.
You either need to
- remove the flush="true" attribute
- put the response.redirect earlier in the code
Another thing you may need to know.
Just because you TOLD the server to redirect the response doesn't mean the current page stops running
After issuing a forward/redirect, you should immediately return from your page.
Standard approaches:
or
James Sutherland wrote:Also ensure your have your JPA provider jar on the classpath (in your case this would be toplink-essentials.jar)
Bill Gorder wrote:Do you have a <provider> tag in your persistence.xml? It seems you do not have a persistence provider defined.