Meaningless Drivel is fun!
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFS: Problems with running servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFS: Problems with running servlet" Watch "HFS: Problems with running servlet" New topic

HFS: Problems with running servlet

kavya krushi
Ranch Hand

Joined: Oct 25, 2000
Posts: 48
Hello folks,

I am seeing a wierd problm when i tried to deploy the servlet. I am able to see the form.html with out any problm ... but when i click the Submit, i am getting a FileDownload box which says that

"You have chosen to download a file from this location from localhost"

and then it gives me an option to either "open the file from the current location" or "save it to the disk". When I have chose the former option it
gave me another dialog with a list of applications that can be used to open the file ... I have selected Internet Explorer and then it brought up a page which displayed the following

Beer Selection Advice <br>
<br>Got Beer Color dark

I am not sure why this is happenning ... I am new to all this web stuff ... I really appreciate it much if some can help me understand thsi problem ...

Thanks and Regards
Peter Du

Joined: Oct 29, 2004
Posts: 14
Can you show the contents of your wen.xml, and you can try the following web.xml :

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns=""

<!-- servlet mappings start -->
<servlet-name>Ch3 Beer</servlet-name>

<servlet-name>Ch3 Beer</servlet-name>

Peter Du<br /> <br />SCJP1.4 SCWCD1.4 SCBCD1.3
kavya krushi
Ranch Hand

Joined: Oct 25, 2000
Posts: 48
Thanks for the response Peter ... Here are the contents of my web.xml ... I just typed everything from HFS & JSP ...

I will try with your web.html ...

[ November 27, 2004: Message edited by: kavya krushi ]
kavya krushi
Ranch Hand

Joined: Oct 25, 2000
Posts: 48
I had mistyped the arg for setContentType method in my doPost metohd. Instead of "text/html", i had "type/html". Once i changed that, things started working great ...

Thanks & Regards,
I agree. Here's the link:
subject: HFS: Problems with running servlet
It's not a secret anymore!