Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in pointing to a servlet from image tag.

 
gayathri murugesan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



this is the servlet that i am trying to call from another servlet using

out.println("<img src='/worst?id=5'>");

but i am not getting the image . please help me out.
 
Paul Clapham
Sheriff
Pie
Posts: 20958
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's possible that URL doesn't point to your servlet correctly. It's possible that the SQL query doesn't select any rows. It's possible that your database code throws an exception. I'm sure there are other possibilities. So given all of that, it would help if you explained exactly what you see instead of just saying you don't get the image. You might also want to review the server logs and debug your servlet code to see what, if any, lines of code are being executed.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Paul Clapham said, "explained exactly what you see instead of just saying you don't get the image".

Check the url that your method is creating. It is possible that this url is poiting to some invalid link.

[=
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64700
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Paul pointed out, most likely the URL is invalid. Do a View Source of the page and cut/paste the URL of the image tag into the browser address bar. Does the image appear? If not, the URL is not correct.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic