Hi Guys,
 
I have one doubt abt user defined function in JSP file.Is there any way to define user function in JSP file?
 
Thanks in advance
Rajiv
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.

Reply via email to