Pages

Tuesday 29 October 2019

5 example on jsp

example 1
__________________
<html> <body>
<% out.print("Welcome to KLN JSP Class\n"); %>
</body>
</html>
___________________
example 2
__________________
<html> <body>
<% out.print("Addition Of two number\n"); %>
<br>
<% int a=5, b=10, c; c=a+b;
out.println("Sum of Two Numbers =" + c); %>
</body>
</html>
__________________
example 3
__________________
<html> <body>
<h3> <% String str1 ="Mr. KLN"; %>
<% String str2 =""; %>
Welcome to <%=str1 %> </h3>
<% if(str1.equals("Mr. KLN"))
out.println("Hi "+str1);
else
out.println("Hello ");
%>
</body>
</html>
__________________
example 4
__________________
<html> <body>
<p>Today's date:
<%= (new java.util.Date()).toLocaleString()%>
<br> CLASS Time : <%= 7+2 %> : <%= 20 %>
</p> </body> </html>
__________________
example 5
__________________
<html>
<body>
<%!intdata=50;%>
<%="Valueofthevariableis:"+data%>
</body>
</html>

No comments:

Post a Comment