Hello, I am reading HF Servlets & JSP book. I am on the exercise at page 81. I am unable to compile the servlet. Compiler is unable to find javax.servlet.* package. I also set the CLASSPATH in environment variables(C:\jakarta-tomcat-5.5.5\common\lib . Can someone help me. What do I need to do to resolve this error?
Hi, I have one more problem can U Please help me. This is the same exercise on page 81. I have my class file, HTML and web.xml in place. I am trying to run the app. I am able to see the form.html but when I click on submit query, I get this error(HTTP Status 405-HTTP method POST is not supported by this URL. I am not able to understand what I did wrong. http://localhost:8080/Beer-v1/SelectBeer.do
type Status report
message HTTP method POST is not supported by this URL
description The specified HTTP method is not allowed for the requested resource (HTTP method POST is not supported by this URL).
Hi Suja, I Think...In HTML You Are Using POST And In Servlet Source File You Are Using doGet().That Is The Reason You Are Getting The Error.Make Sure The action Attribute Value In HTMl Must Match With Corresponding doXXX() In Servlet. Bye. Prasad Pusapati.
Joined: Jul 28, 2004
Prasad, I had a typo for dopost() instead of doPost() Now I am getting this error. It is not able to see the class file. The actual path of the class file is C:\jakarta-tomcat-5.5.5\webapps\Beer-v1\WEB-INF\classes\com\example\web
HTTP Status 404 - /Beer-v1/com/example/web/BeerSelect
type Status report
description The requested resource (/Beer-v1/com/example/web/BeerSelect) is not available.
This 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>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>
I am not able to see what I am doing wrong. Please help. [ January 28, 2005: Message edited by: Suja Mudunuri ]