• Post Reply Bookmark Topic Watch Topic
  • New Topic

How we write Method in JSP's  RSS feed

 
Nadeem Ahmad
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I want to know that How we declare class variable,methods in JSP's
Thanks in advance
Nadeem
 
Chris Baron
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nadeem,
an declaration-block starts with <%!

<html><body>
<%!
private static final String hello = "Hallo ";

private String hello( String param )
{
return hello + param;
}
%>
<%= hello(request.getParameter( "param" ) ) %>
<form action="<%=request.getRequestURL()%>">
<input type="text" name="param"><input type="submit">
</form>
</body></html>
 
Nadeem Ahmad
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Very much
Chris
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!