JSP Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
JSP Tutorial
Introduction Introduction
Installing JDK-Windows Installing JDK-Windows
Installing JDK-Linux Installing JDK-Linux
Installing Tomcat Installing Tomcat
Simple Program in JSP Simple Program in JSP
Pre-defined Variables Pre-defined Variables
Syntax of Tags Syntax of Tags
JSP Expression Language JSP Expression Language
JSP EL Operators JSP EL Operators
EL Implicit Variables EL Implicit Variables
Scopes Scopes
Using Arrays Using Arrays
Methods Methods
JSP Elements JSP Elements
Including Beans Including Beans
JSTL Tags JSTL Tags
Custom Tags Custom Tags
Session Session in JSP
Handling Cookies Handling Cookies
JSP Application Structure JSP Application Structure
Configuring web.xml Configuring web.xml
Tomcat Configuration Tomcat Configuration
JSP Examples JSP Examples
Forums Ask Your Doubts
Feedback Feedback
 






outsourced web hosting support

Using Array in JavaServer Pages


Tutorials Jsp

Topic

Using Array in JavaServer Pages?



Explanation

Since JSP is not a complete programming language it does not have array structure but array declared using Java can be used in JSP.

Example:
    <%
     String[] arr={"apple","orange","cherry"};
    %>
    <%
     int j;
     out.println("<p>The array elements are</p>");
     for(j=0;j<arr.length;j++){ 
       out.println(arr[j]);
      } 
    %>
Result:
    The array elements are
    apple orange cherry 

In the example we have declared a string array "arr". Using a for loop every element of the array is displayed.




Other Links

web hosting