This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Declaration

 
Mathew Sam
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the difference between variables declared using scriplets tag and using declaration tag.
1)<% String s; %>
2)<! String s %>
 
Arun Boraiah
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
<% declaration %> (scriplet tag) the variable declared will be local to method(say service or user defined method).
<%! code %>(Declaration tag) code is inserted inbody servlet class, outside of service method. There by avaliable for all mehtod's of that jsp.
-arun
 
Mathew Sam
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the info
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic