File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Declaration

 
Cameron Park
Ranch Hand
Posts: 371
  • 0
  • 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
  • 0
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic