Home Jsp Simple-jsp-example While Loop in JSP



While Loop in JSP
Posted on: March 11, 2008 at 12:00 AM
The while loop is a control flow statement, which allows code to be executed repeatedly based on the given boolean condition.

While Loop in JSP

        

The while loop is a control flow statement, which allows code to be executed repeatedly based on the given boolean condition. In while loop the condition is firstly evaluated, if it finds that the condition is true, then the code will be executed. This process will continue until the condition becomes false. This loop is also known as pre- test loop. 

We have made a program on while, after going through this example the while loop become much more clear to you.

The code of the program is given below:

 

 

<HTML>
  <HEAD>
    <TITLE>While Loop in Jsp</TITLE>
  </HEAD>
  <BODY>
    <H1>While Loop in Jsp</H1>
    <%
             int n = 0;
		out.println("Number:");
		while(n<10){
		out.println(" , "+ n);
		n++;
        } 
    %>
  </BODY>
</HTML>

Output of the program:

 

Download this example.

Related Tags for While Loop in JSP:
coopcomstlprocesscontrolioluasedfindlooptestbooleanexecevalstateolethisexeooifbooconditionexampleexecuteclearprogramstatementwhiletorambaseexamflowboolprocwseareilitlspefirstcecontinueinnorepeatasstamnttrleanadafterbasedclesthroughrepeatedtrueemfalseaseallmehrproevaluatecutxawhichxampuatsxesoessatkisirhallivmplpregoeaarstatcodcodevassrocthcondavstaluafhatevafinevalsopleplprocesprndodeonomogrolo


More Tutorials from this section

Ask Questions?    Discuss: While Loop in JSP  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.