File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Problem running Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem running Servlet" Watch "Problem running Servlet" New topic

Problem running Servlet

mithun gooty
Ranch Hand

Joined: Mar 14, 2006
Posts: 33
Whenever i try to run the following servlet i dont the get output in the current window, instead it displays the following message "Do you want to save?". Each time i need to save to a local folder, double click and open it with the internet explorer. I am using Tomcat5.5.

All the servlet does is take a string and vertically transpose, and display it as an image. Can anybody give the reason as to why this is happening?
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
How about if you click any image link from your browser? Does it ask to save? I mean, is it asking to save the url below?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
I think the proper content type is "image/jpeg", not "image/jpg".
mithun gooty
Ranch Hand

Joined: Mar 14, 2006
Posts: 33
Hey thank you very much Ulf. I made the changes according to your comments and now its working fine.
I agree. Here's the link:
subject: Problem running Servlet
It's not a secret anymore!