Switch to full style
JSP Code Examples
Post a reply

Creating a Method in jsp

Thu Jan 15, 2009 11:30 pm

Example show how to make initialization for function within jsp tags . Numbers double function is created .
Note: That the "out" object is not allowed to be used within the <%! tags %>

Code:
<HTML>
  <
HEAD>
    <
TITLE>Creating a Method in jsp</TITLE>
  </
HEAD>

  <
BODY>
    <
H1>Creating a Method in jsp</H1>
    <%!
    
   
    
int Double(int number)
    {
      return 
2*number;
    }
    %>

    <%
    
out.println("The Double of 3 is = " Double(3));
    %>
  </
BODY>
</
HTML>

 




Post a reply
  Related Posts  to : Creating a Method in jsp
 Creating a Directory in php     -  
 Creating table using div tag     -  
 creating non ordered list using UL tag.     -  
 Creating Glass Buttons     -  
 creating arrays in java     -  
 Creating a Database in MySQL     -  
 Creating Menu Button     -  
 Creating a JAR file in Java     -  
 creating database in netbeans     -  
 Creating a Flash Banner     -  

Topic Tags

Servlets/JSP