This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes What is the problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "What is the problem?" Watch "What is the problem?" New topic
Author

What is the problem?

Bal Sharma
Ranch Hand

Joined: Sep 19, 2001
Posts: 273
Hello Everybody:
I am trying to run tomcat. I had a problem for about a week, I could not compile servlet. William Brogden help me out on this. Thanks Bill, I can compile Servlet now. But, It is not working at displaying. I saved my complied class file at /example/WEB_INF/classes/ location. I used http://localhost:8080/examples/servlet/HelloServlet. It pops up file downloading window and starts downloading activity.
Had anyone this problem before? please let me know what is solution?
Thanks. BK
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16158
    
  21

It sounds like what you are saying is that when you visit the HelloServlet, it is attempting to output in a MIME format that isn't supported for display. Check your servlet source code for a statement that sets the content type header such as "response.setContentType("text/html")". If you don't have one, that may be your problem. Otherwise, make sure it's spelled right.


Customer surveys are for companies who didn't pay proper attention to begin with.
Bal Sharma
Ranch Hand

Joined: Sep 19, 2001
Posts: 273
<b>Thnak you Tom.</b>
You know what I am stupid. I had 'response.setContentType("text/html")' statement, but I mistyped. response.setContentType("test/html")". Zee! I wasted more than a week wondering as instalation problem. Rock and roll, I got rolling now. Thanks again BK
I hsd
Originally posted by Tim Holloway:
It sounds like what you are saying is that when you visit the HelloServlet, it is attempting to output in a MIME format that isn't supported for display. Check your servlet source code for a statement that sets the content type header such as "response.setContentType("text/html")". If you don't have one, that may be your problem. Otherwise, make sure it's spelled right.

 
Don't get me started about those stupid light bulbs.
 
subject: What is the problem?