Frits Walraven wrote:Ok, try this:
http://localhost:8080/JSPTest/OverridingJspInit.do
You have a servlet mapping from OverridingJspInit.do -> >/OverridingJspInit.jsp
What you are doing is going to the page via direct access (like accessing a static html page), so you are not creating a servlet.
Regards,
Frits
I can't believe it ... i had mapping and i was accessing it differently ... so that was the main reason in my point of view.
but i'm still confused about your statements:
1. Direct Access, like accessing a static html page [as i read in the book, the jsp files are supposed to be stored in webapp root directory and than accessed via
http://localhost:8080/webapp-root/jspfile.jsp ....]
I had mapping for the <jsp-file> only because i was overriding jspInit() method, otherwise jsp pages doesn't need a mapping right, hence do you call that direct access???
check this code [same code, just one one expression added] :
check line number#12.
run this jsp file using :
http://localhost:8080/JSPTest/OverridingJspInit.jsp
see the output, it will give you null values for the two parameters, but it executes the date perfect ... hence the servlet is created always when the request is made to the jsp page, right?
2. You are not creating servlet ...! how is that possible ... [as i read the moment jsp file is requested ... the container will create a servlet for that particular jsp file ..... even ]
why am i asking these questions are because i will be appearing for the exam soon, so if i could get some valuable information from your side, will definitely benefit me ;-).
thanks for the reply
regards,
Rafi