JSP

JSP Projects

JSP Project

What are embedded control flow statements in JSP?
Previous Home Next

 

JSP use all important features of java and use all its powerful APIs and building blocks.

The embedded statements of the JSP are divided into two categories Decision making statements and control flow statements.
Decision making statements are:
if ..else and switch case are two decision making statements.
control flow statements are:
For loop ,while and do-while loop.
 1)The function of the the statements are same as in java programming.

1.1 if else

if else loop is use for condition check. The if-then statement is the most basic of all the control flow statements. It tells your program to execute a certain section of code only if a particular test evaluates to true. 

1.2 SwitchCase

switch case is used to check a number of possible execution paths. A switch can work with the byte, short, char and int primitive data types. 
1.3 for, while and do while loop

for loop allows a code to be repeatedly executed. A for loop is classified as an iteration statement.
Difference between while and do while is that while statement continually executes a block of statements while a particular condition is true whereas do while evaluates its expression at the bottom of the loop instead of the top. Therefore, the statements within the do block are always executed at least once. 

1.4 enhance for loop

In JDK 1.5 (tiger) release of Java new feature of the enhanced for loop was introduced. Enhanced for loop allows you to iterate through a collection without having to create an Iterator or without having to calculate beginning and end conditions for a counter variable. 


 

Previous Home Next