Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP basics

 
vasu maj
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
People,
I am starting to preapare for SCWCD exam from today. I have taken a look at some JSP basics today and have this question..
A declaration is where you declare a variable or method. You can do the same thing using the scriptlets. What is the difference? Or is it just two ways of doing it?

Thanks and expect more from today on..

Vasu
 
Andriy Podlyesnyy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Declaration it's like in regular java class instance variable declaration and method declaration.
Everything what is inside scriplet goes into _jspService method. As you already know you can not declare methods inside another methods.
 
AJAY RANA
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes , Every variable u declare in declaration is instance variable(so need not initialized).
--every variable declared in scriptlet goes into _jspService method as "LOCAL VARIABLE" hence need explicit initialization.
-- u can't declare a method in scriptlet (because a method can't be declared inside another method(_jspService).
Regards,
Ajay Rana
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic