Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

methods  RSS feed

 
lakshmi pokala
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to write our own (user defined) methods in JSP?

Thanks in advance.
 
Shraddha Jain
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%! your method(){
}
%>
thats it! write this method like you would write one for a java class.
Conditions Apply
[ March 05, 2006: Message edited by: Shraddha Jain ]
 
NandaM Kishore
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it would be better if we use scriptlet than a declaration tag.
what do you say shraddha???
 
Shraddha Jain
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
puttinng anything between <% %> goes into your service method, right? here we want to write a method and probably call it from within the service method. so calling the method should happen within <% %>

<%! yourmethod(){
}
%>

<% yourmethod();%>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!