Friday, March 27, 2015

Continue in JSP

Continue statement in JSP ? 

In JSP continue  is a statement and this statement is used to carry on loops or to exit from a switch . It can be used within a for, while, do –while etc.

Example:

JSP File (continue.jsp)
 <!DOCTYPE html>  
 <html>  
 <head>  
 <title>nirajanghimireyworkshop.blogspot.com</title>  
 <meta charset="UTF-8"/>  
 </head>  
 <body>  
 <h2>Continue Statement in JSP</h2>  
 <%  
 int i;  
 for (i= 0;i< 20;i++) {  
 if(i==5){  
 out.println("continue <br/>");  
 continue;  
       }  
 out.println("X = " + i+ "<br/>");  
    }  
   %>  
 </body>  
 </html> 

No comments:

Post a Comment