File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 16305
    
  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.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What is the problem?