• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eduardo's exam question

 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ! consider this one :
<% public void jspInit() { ...java code...} %>
And the answer says
It is a valid line that can be used to initialize the servlet that implements the jsp file.
I think the answer is incorrect
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now if it would have the <%! exclamation mark...
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the answer is incorrect
Yup, it is incorrect.
This code will endup in the _jspService(..) method in the given form, which will result in errors.
When the code follows Peter's suggestion, it will be a method outside the _jspService(...) and would be used to init the JSP.
regds.
- madhav
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic