Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet not getting invoked  RSS feed

 
Eshwari Issakkimuthu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I tried the sample application in "Heads First Servlets and JSP" chapter 3.
I have the same directory structure as given in the book. Still, it is giving "Page Not Found" error message after I choose a beer-color in the HTML and say submit.
Please help.
Thanks,
Esh
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Esh Esh",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post your web.xml?
 
Eshwari Issakkimuthu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for letting me know the rules regarding display name. I have changed it.

Here is my web.xml
<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/web-app_2_4.xsd"
version="2.4">

<servlet>
<servlet-name>Ch3Beer</servlet-name>
<servlet-class>com.example.web.BeerSelect</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Ch3Beer</servlet-name>
<url-pattern>/SelectBeer.do</url-pattern>
</servlet-mapping>
</web-app>

Thanks,
Eshwari
 
Krishna Srinivasan
Ranch Hand
Posts: 1880
Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

web.xml look OK. I think the problem with your server configuration. which server are using for this application?
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page Not Found :
means The file that you requested could not be found on this server.

I think you need to recheck you directory structure.. regarding placing your jsp and class files..

hope it helps..
[ February 16, 2007: Message edited by: Saif uddin ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Eshwari I", you have previously been warned on one or more occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. Initals for a last name are not acceptable.

Be aware that accounts with invalid display names are removed.

bear
JavaRanch Sheriff
 
Amar Deep Singh Chaudhary
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear Eshawari
first you make some change in your web.xml file as it
<web-app >
<servlet>
<servlet-name>Ch3Beer</servlet-name>
<servlet-class>com.example.web.BeerSelect</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Ch3Beer</servlet-name>
<url-pattern>/SelectBeer.do</url-pattern>
</servlet-mapping>
</web-app>

then restart your server and ask for your file from browser again by typing the url in the browser
http://localhost:70001/war_file_name/urlpattern_name.

i don't know which server you are using it is for weblogic8.1
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!