5. Java Server Page (JSP)

5.1 Develop a simple JSP program for user registration and then control will be transfer it into second page.

index.html
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<form action="second.jsp" method="post">
Enter your UserName: <input type="text" name="name"><br>
Enter your Password: <input type="password" name="pas"><br>
Enter your email: <input type="email" name="email"><br>
<input type="submit">
</form>
</body>
</html>


second.jsp
<%--
Document : second
Created on : 27-Oct-2021, 10:28:44 AM
Author : arpit
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
String name=request.getParameter("name");
String password=request.getParameter("pas");
String email=request.getParameter("email");
out.println("You Entered Name : "+name+"<br>");
out.println("You Entered pass : "+password+"<br>");
out.println("You Entered email : "+email+"<br>");
%>
</body>
</html>

Output

index page
index page


second page

Happy Coding :)