The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

CatchSandeepVaid (23) [Avatar] Offline
#1
I would like to ask this question specially to hanumant deskmukh.

I am using SCWCD Exam Study Kit (2nd edition). In this you mentioned that we are using Tomcat5.0.25. Now in your first HelloWorldExample (page-8,9,10), your web.xml is
<web-app .....>
<servlet>
<servlet-name>HelloWorldServlet</servlet-name>
<servlet-class>HelloWorldServlet</servlet-class>
</servlet>
</web-app>

You mentioned : Open a browser window and go to URL http://localhost/chapter01/servlet/HelloWorldExample

Which in Tomcat 5.0.25 doesn't work....

When i went to jdiscuss.com i found that :
<!-- <br /> Following mapping is required for Tomcat 4.1.x <br /> In earlier versions of Tomcat, /servlet/HelloWorldServlet url pattern works even without this servlet mapping. <br /> <servlet-mapping> is explained in Chapter 5. <br /> -->
<servlet-mapping>
<servlet-name>HelloWorldServlet</servlet-name>
<url-pattern>/servlet/HelloWorldServlet</url-pattern>
</servlet-mapping>

But we are using Tomcat 5.0.25 (according to book), then why doesn't the examples include servlet-mapping?
Moreover i think the book should be written in a way that :
1. It should not be according to a specific servlet container.
2. It should mention the assumptions and clearly mention that this is due to tomcat settings..