Chapter 2 JSP
Chapter 2 JSP
Semester: Seven
elements
A.scriptlet tag
B.expression tag
C.declaration tag
<html> <body>
</body> </html>
The index.html file gets the username from the user and
the welcome.jsp file prints the username with the
welcome message.
•<html> <body>
•<form action="welcome.jsp">
•</form>
•</body>
•</html>
File: welcome.jsp
•<html> <body>
•<%
•String name=request.getParameter("uname");
•out.print("welcome "+name);
•%>
•</form>
•</body> </html>
<body>
</body>
</html>
index.jsp
<html> <body>
</body> </html>
File: index.jsp
•<html> <body>
•<form action="welcome.jsp">
•</html>
•<html>
•<body>
•</body>
•</html>
The jsp scriptlet tag can The jsp declaration tag can
only declare variables not declare variables as well as
methods. methods.
index.jsp
<html>
<body>
</body> </html>
But we can also use jsp scriptlet tag to call the declared method.
index.jsp
•<html>
•<body>
• return n*n*n*;
•}
• %>
• </body>
• </html>
Any Questions
Thanks For your Listening