• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem to show image generated from servlet

 
luca invernizzi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a problem with a Servet that generated an image (QRcode).


The Servlet is:




In the JSP page I want to display the image with:



But the image result empty and it show nothing.

I tried to set a button to show the image in an other page and it works:



What is the problem with the img tag?
How can I correctly display also in the page with the img tag??
I have to modify the Servlet?

 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your image generation is inside the doPost method, normally at form submission.

If your QR code image has nothing to do with the form inputs, you can generate the image when the JSP page loads (in the servlet doGet method).
 
luca invernizzi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you,

with doGet it works!

Now I'll use process request and it works with the form-post and with the img tag.

Thanks a lot!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic