• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About service local variables

 
El Zhang
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in jsp file
<% int i=0; %>
here i will be a local varible of the service method of generated servlet, correct?
My first guess is wrong, because actually i will be a local variable of the _jspService method which will be called by the service method.
I am confused because the answer is not what I expected. Any help? thanks in advance
 
Marcus Howarth
Ranch Hand
Posts: 38
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yikes - I'd be confused there too.. I'm just starting on my SCWCD prep...
A quick search on _jspService comes up with the tomcat API of the HttpJspPage interface. This is what the servlet generated during your JSP life cycle implements.
I've found reference to it on p.183 of Sam Dalton & Dan Jepps book - albeit barely a page!
 
Bryan Basham
author
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Elton,
If a JSP question were to be written about a service method, then the question would have been thrown out because it would be deemed "tricky". Because as you noted a JSP page generates a _jspService method.
No such question would be found on the exam.
Regards,
Bryan
 
El Zhang
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all, Marcus and Brian. I found many mock exams are actually more difficult (tricky) than the real test.
I am pleased to know this kind of questions will not come up in the real exam.
Thanks again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic