Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Difference b/w jsp scriptlet and deceleration Elements

 
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 ?
 
Ranch Hand
Posts: 826
Eclipse IDE Oracle Chrome
  • 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.
 
Do not threaten THIS beaver! Not even with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic