Re: How to define a function within a JSP ?

declare the method in a declaration tag like

<%!


boolean isDefined( HttpServletRequest req, String name, String value )

{
    String vals[] = (String [])req.getParameterValues(name);
    if (vals != null)
    {
      for (int i = 1; i<vals.length; i++)
      {
        if( value.equalsIgnoreCase(vals[i]) )
          return true;
      }
    }
    return false;
}
%>

and continue as usual like isDefined(request,"name","value")

thanx,
Suresh

Received on Tuesday, 27 March 2001 10:21:57 UTC