This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Declaration

 
Cameron Park
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I was wondering if methods can be decalred in JSP declarations like class variables. If so, how is it done?
Is
<%!String toString(){
StringBuffer temp = new StringBuffer();
for(int i=0; i<10; i++){
temp.append(Integer.toString(i));
.append("\n");
}
return temp.toString();
}%>
valid?
 
gsaha
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can do that!! this Declaration block <%! %> will added to the outside of the _jspService() method. Other Scriplet block <% %> will added to the inside the _jspService() method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic