initTest.jsp File :
Now it says that :
When JSP page initTest.jsp is accessed as a servlet, using the http://localhost:8080/chapter11/servlet/InitTestServlet it will work fine.
Ques 1: How can you access using Servet-Name?
Ques 2 : when i define proper servlet-mapping, then i can access it using url-pattern but when i print all the init ariables (not in above code) the output comes as :
fork : false xpoweredBy : false <Now proper init varaibles > ?
Why extra parms : fork and xpoweredBy ?
Originally posted by Stein Vom:
You can a servlet directly without url-pattern with
Can you point out where did you get this from? Is it in the spces?
I am asking because in the exam we won't be tested on tomcat but on what the spec says.
Darren is right. In your DD you have this:
and you are using link <a href="http://localhost:8080/chapter11/<i rel="nofollow">servlet/InitTestServlet</i>" target="_blank">http://localhost:8080/chapter11/servlet/InitTestServlet to invoke the JSP. Thus you are not accessing your JSP with the value of <servlet-name> but with the name in <url-pattern>.
Suppose i have only defined <servlet> element in web.xml & not <servlet-mapping> as in :
then according to the book, i can access my JSP using :
Note: this is not working. Moreover how can i use a servlet-name to access JSP/servlet ?