This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes Not able to print the output on browser Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Not able to print the output on browser" Watch "Not able to print the output on browser" New topic
Author

Not able to print the output on browser

Jyothirmai Vissapragada
Greenhorn

Joined: Sep 22, 2006
Posts: 4
Hi,

I am preparing for SCWCD exam. I am following Kathy Sierra's textbook - Head First Servlets and JSPs.

I am practicing the programs given in the text book for better understanding. There is a program in chapter-3, where the user will select one of the items (coffee/beer color) from the drop down menu which is a HTML file. Now, based on the user selection, the servlet should give some suggetions that which kind of beer/coffee brands the user may want to try.

Everything is working fine for me except, after the user selects the item and hits the button, there is a file getting created on my machine to which the suggested brands are getting written. I am not able to understand why is it happening. I want the output (brand suggestions) to be displayed on the browser window. Please let me know how can I fix it and what is going to wrong.

Below, I attached my HTML and Servlet codes.



My servlet's doGet() and doPost() looks like this:



Thank you.

KiranJyothi
DaslanJ Govender
Greenhorn

Joined: Jul 25, 2007
Posts: 6
try response.setContentType("text/html")
Jyothirmai Vissapragada
Greenhorn

Joined: Sep 22, 2006
Posts: 4
Hi,

Thanks for the reply. It worked now.

Have a good day!!!

Jyothi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not able to print the output on browser
 
Similar Threads
servlet programming problem in Eclipse
Starting out on Servlets - from Head First Servlets and JSP
error with mvc application
Why this EL code part is not working
404 error is coming after submiting the form how to resolve it