This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi I have created a chapter01 directory under C:\jakarta-tomcat-4.1.18\webapps Next, I created a WEB-INF directory under C:\jakarta-tomcat-4.1.18\webapps\chapter01 I developed a HelloWorldServlet, the code is as follows:
I compiled the servlet and copied it under C:\jakarta-tomcat-4.1.18\webapps\chapter01\WEB-INF\classes The C:\jakarta-tomcat-4.1.18\webapps\chapter01\WEB-INF also has web.xml
I started the tomcat as follows: C:\jakarta-tomcat-4.1.18\bin>startup I opened the browser and typed the following url http://localhost:8080/chapter01/servlet/HelloWorldServlet I got the following response: description The requested resource (/chapter01/servlet/HelloWorldServlet) is not available. What must be the reason? Thanks Ravi
The <servlet-mapping> tag is required with Tomcat 4.1.18 - it wasn't previoulsy so it can cause some confusion since previous versions of Tomcat (4.0.x, etc.) did not require this tag.
Joined: Nov 04, 2000
Hi The problem has been resolved after I used the servlet mapping. Thanks Ravi
Joined: Dec 21, 2002
Put the below servlet mapping in web.xml and this will lead your all servlet to execute without doing servlet mapping individually <servlet-mapping> <servlet-name>invoker</servlet-name> <url-pattern>/servlet/*</url-pattern> </servlet-mapping> BY! guru