Bear Bibeault wrote:Step 1: move the servlet into a package other than the default.
Bear Bibeault wrote:Step 1: move the servlet into a package other than the default.
SCJP 5.0, SCWCD 5.0, SCBCD 5.0
ryan sukale wrote:Hi Anurag,
Now that you have moved the class file to the appropriate directory, you need to understand the <url-pattern> tag correctly.
the url pattern in your web.xml file is : /Serv1
The backslash represents the application's root directory. In this case, your root directory is : anurag
so in your browser window, type the following : http://localhost/anurag/Serv1
The string that you specify in the browser should be the same that appears in the url-pattern.
I hope it helps.
Kindly inform me if i have written something incorrect. Thanks.
K Tewari wrote:Can you also check if your application is actually deployed on the server(a directory with name 'anurag' under TOMCAT_HOME/work). I suspect, your application is not correctly structured.
Keep this structure :
anurag
|
WEB-INF -> web.xml
|
classes
|
com
|
example
|
web -> Ch1Servlet.class
and then try this url : http://localhost:<<your_port>>/anurag/Serv1
SCJP 5.0, SCWCD 5.0, SCBCD 5.0
Anurag Patil wrote:6. tomcat/webapps/ch1/WEB-INF/src
Consider Paul's rocket mass heater. |