Adv. Java Practical
Adv. Java Practical
Adv. Java Practical
PRACTICAL
Q1. Write a program to print the IP address.
<!DOCTYPE html>
<html>
<head>
<title>JSP Page</title>
</head>
<body>
<br>Hello World!<br/>
%>
</body>
</html>
OUTPUT SCREEN
Q2. Write a program using JSP declaration scriplet.
<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
Hello World!<br/>
out.println(i);
%>
</body>
</html>
OUTPUT SCREEN
Q3. Write a program using JSP expression scriplets.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>
</p>
</body>
</html>
OUTPUT SCREEN
Q4. Write a program using JSP comments scriplet.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
OUTPUT SCREEN
Q5. Create a form in HTML which will take student along with 5 subject marks.
<!DOCTYPE html>
<html>
<head>
<title>Q1</title>
</head>
<body>
</form>
</body>
</html>
Q6. Create a Registration form.
<!DOCTYPE html>
<html>
<head>
<title>Q2</title>
</head>
<body>
</form>
</body>
</html>
Q7. Create JSP page print table of a number in given format.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<tr>
<td> * </td>
<td> = </td>
</tr>
<% } %>
</table>
</body>
</html>
Q8. Create HTML form asking student detail enrollment, name, DOB, Program, Fee
along with submit. Clicking on submit welcome.jsp shows greeting.
Index.jsp
<!DOCTYPE html>
<html>
<head>
<title>Q6</title>
</head>
<body>
<label for="dob">DOB</label>
</form>
</body>
</html>
Welcome.jsp
<!DOCTYPE html>
<html>
<head>
<title>Q6-Welcome</title>
</head>
<body>
</body>
</html>
H
E
L
L
O
D
I
V
Y
A
Q9. Create index.jsp where you enter a number and submit it to table.jsp where you
want to display table of given number in required format.
Index.jsp
<!DOCTYPE html>
<html>
<head>
<title>Q7</title>
</head>
<body>
</form>
</body>
</html>
Table.jsp
<!DOCTYPE html>
<html>
<head>
<title>Q7-Table</title>
</head>
<body>
<tr>
<td> * </td>
<td> = </td>
</tr>
<% } %>
</table>
</body>
</html>
Q10. Create index.jsp where you enter a number and submit it to math_cal.jsp where
you want to display table containing following properties odd even prime palindrome.
Index.jsp
<!DOCTYPE html>
<html>
<head>
<title>Q8</title>
</head>
<body>
</form>
</body>
</html>
Math_cal.jsp
Q11. Create index.jsp and design student form having fields Name Address DOB create
check boxes for course selected print atleast 5 courses clicking on submit calls
summary.jsp which display the courses opt by student and show number of courses opt.
Index.jsp
<!DOCTYPE html>
<html>
<head>
<title>Q9</title>
</head>
<body>
<label for="dob">DOB</label>
</form>
</body>
</html>
Summary.jsp
<!DOCTYPE html>
<html>
<head>
<title>Q9-Summary</title>
</head>
<body>
? 0 : request.getParameterValues("course").length%> courses</h3><br>
<tr>
</tr>
<% }%>
</table>
</body>
</html>
Q12. Write a program to produce the following output.
<!DOCTYPE html>
<html>
<head>
<title>Question 1</title>
</head>
<body>
<h1>table creation</h1>
<table border="1">
<tr>
<td>
<h3>LOGO</h3>
</td>
</tr>
<tr>
<td colspan="1">
<h4> MENU</h4>
</td>
<td>
</td>
</tr>
</table>
</body>
</html>
Q13. Write a program to produce the following output.
<html>
<body>
<tr>
<td>
</td>
</tr>
<tr>
<td colspan="1">
<h4>ABOUT US</h4>
</td>
<td>
</td>
</tr>
</table>
</body>
</html>
Q14. Write a program using For loop.
<!DOCTYPE html>
<html>
<head>
<title>JSP Page</title>
</head>
<body>
<%
{ %>
<%}%>
</body>
</html>
Q15. Write a if else loop program to display date.
<!DOCTYPE html>
<html>
<head>
<title>JSP Page</title>
</head>
<body>
<%
if (day == 1 | day == 7)
{ %>
<% }
else
{ %>
<% } %>
</body>
</html>