quote: viswanath
-------
"and when i use, the following two cases, iam getting the same result,
1.
http://localhost:8080/chapter12/servlet/ InitTestServlet
2.
http://localhost:8080/chapter12/initTest.jsp" --------------------------------------------------
No 1)This is the "registered servlet name".
Most servers(tomcat) have a default URL for servlets :..../webapplication/servlet/ServletName.
When you don't use servlet-mapping to access a registered or unregistered servlet then you have to use "servlet" (Invoker Servlet) entry in the URL.
If u want u can disable the Invoker Servlet so that only custom URLs can access servlets.
No 2) This is the real name and location of the jsp page (so no problem)
No 3).
http://localhost:8080/chapter12/InitTestServlet Although this is the servlets registered name but
1,u can't access it without "servlet" entry.
2, your (servlet-mapping) url-pattern is /initTest.jsp if it was /InitTestServlet it would have worked.
NOTE:
Initialization parameters r only available when servlets r accessed by means of their registered names or through custom url
patterns associated with their registered names.