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 table using div tag     -  
 Creating a Directory in php     -  
 Creating a Flash Banner     -  
 Creating Effective Clouds     -  
 Creating Brushes with Illustrator     -  
 Creating Rollovers in Photoshop     -  
 Creating your own Exceptions in Java     -  
 creating non ordered list using UL tag.     -  
 Creating Glass Buttons     -  
 creating arrays in java     -  

Topic Tags

Servlets/JSP