Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head First Servlets & JSP Beer Advisor App.

 
Toussaint Derrett
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been trying to run the Beer application, however on submitting the
form a window displays asking me if I wish to open, run or save
SelectBeer.do. Apparently what is returned to the browser is the Servlet
itself and not the results of running the servlet. Help !!!

Details
Tomcat 5.0.28
JSDK 1.4.2_4
Window XP
NB. All the example applications are working fine.
 
Bert Bates
author
Sheriff
Posts: 8905
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Toussaint -

This is a weird one, but Bryan had a couple of ideas:

- What browser are you using? Is it possible that your browser isn't looking at the Content-Type HTTP header, and instead is trying to identify the content type from the .do extension?
(double check that the content type setting is "text/html")

- Is it possible that your servlet has both of these problems:

1. it's not forwarding to the JSP
2. it's not creating any content

In that case (an empty HTTP response), the browser might get confused.

Let us know what you discover.

Bert & Bryan
 
Toussaint Derrett
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using internet explorer..I will double check the Content-type.
The Beer example I am running now has only the html form and the
servlet. I am not trying the JSP part as yet.
 
Toussaint Derrett
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the results from the servlet to display after tickering with the browser encoding setting. However for me to see the result I have to
open the file when the File Download dialog appears and the choose which
program I want to open the file (SelectBeer.do)... internet explorer...I still want to prevent the file download dialog from appearing any help given would be greatly appreciated...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic