• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference b/w jsp scriptlet and deceleration Elements  RSS feed

 
Pradeeep Sharma
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
can any one tell me that is it correct that JSP deceleration element(<%! %>) are part of the init() method of servlet and JSP scriplet(<% %>) are part of the service() method of the servlet ?
 
sudipto shekhar
Ranch Hand
Posts: 826
Chrome Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeeep Sharma:

can any one tell me that is it correct that JSP deceleration element(<%! %>) are part of the init() method of servlet


Every thing you define using declaration <%! %>element lands up outside the service method but inside the servlet class.
They are like instance variable or methods, and of-course they are not a part of the init().
Every thing you define using <% %> lands up in the service method of the servlet and hence are like local variables of the _jspService() method.

Hope this helps.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!