JSP - Control structures


<!-- Control structures in JSP -->

<html>
<body>

<%! int day = 3; %>

<% if (day == 1 | day == 7) { %>
<p> Today is weekend</p>
<% } else { %>
<p> Today is not weekend</p>
<% } %>

<% if (day == 1 | day == 7)
{ out.println("Today is weekend");
} else {
out.println("Today is not weekend");
} %>

<%! int x=5; %>
<% if (x%2==0)
{ out.println("Even");
} else {
out.println("odd");
} %>

</body>
</html>

No comments:

Post a Comment

Don't be a silent reader...
Leave your comments...

Anu