Yes. For JSP 1.0 and above use the syntax:
<%!
void myFunc()
{
....
}
%>
<%
....
// call
myFunc()
myFunc();
.....
%>
For versions less than 1.0, instead of the <%! %>, use
<script runat="server"> ...</script>. If you do this you need to
pass the implicit objects (out, request, response etc.) as parameters to your
function.
HTH
John Wheeler.
|
- Is There any way to define user function in JSP file? Rajiv Kumar Bandaru
- John Wheeler
