Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HFS: Problems with running SelectBeer.do servlet

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

SelectBeer.do 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
Kavya
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

<!-- servlet mappings start -->
<servlet>
<servlet-name>Ch3 Beer</servlet-name>
<servlet-class>com.example.web.BeerSelect</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Ch3 Beer</servlet-name>
<url-pattern>/SelectBeer.do</url-pattern>
</servlet-mapping>
</web-app>
 
kavya krushi
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ...

Regards,
Kavya
[ November 27, 2004: Message edited by: kavya krushi ]
 
kavya krushi
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
Kavya
 
I am displeased. You are no longer allowed to read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic