iForeRunner
 
   
 
  JAVA  
   
   
   
 
  Declarations in JSP  
 
 
JSP variable and method declaration
declaration

Declarations In JSP Pages

We use declaration section for  declaring or  defining of variables or methods

 

some examples of declaration in JSP pages are as follows

 

Lisitng 1:

<%!

 

int number = 10;

 

%>

 

Listing 1 explains declaring a simple variable

List 2 :

<%!

String name ="http://www.iforerunner.com"

%>

 

List 2 is an example of declaring a String

we can also define a method in JSP pages as follows

<%!

 

String sayHello(String name)

{

return "Hello"+name;

}

%>

 

above three listings are examples of declarations in JSP if we notice each of the variable declarations ends with semi colon ;



Please send comments to vgdarur.javafive@blogger.com

 
     
 
 
 
http://www.iforerunner.com/