File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in pointing to a servlet from image tag.

 
gayathri murugesan
Ranch Hand
Posts: 32
  • 0
  • 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: 20208
26
MySQL Database
  • 0
  • 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
  • 0
  • 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: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic