Practical-16 Develop a simple JSP program for user registration and then control will be transfer it into second page.
index.html:
<!DOCTYPE html>
<html>
<head>
<title>JSP Program</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="pass"><br>
Enter your email: <input type="email" name="email"><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
<html>
<head>
<title>JSP Program</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="pass"><br>
Enter your email: <input type="email" name="email"><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
second.jsp:
<%@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 username=request.getParameter("name");
String password=request.getParameter("pass");
String email=request.getParameter("email");
out.print(username + " Registered Successfully...");
%>
</body>
</html>
Output:
Comments
Post a Comment