The following example code demonstrates how to Display Values Entered in a Registration Form in Another Page in JSP.

Here is an example code for a registration form in JSP and how to display the values entered by the user in another page.

  1. registration.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Registration Form</title>
</head>
<body>

<h1>Registration Form</h1>

<form action="display.jsp" method="post">
  Name: <input type="text" name="name"><br><br>
  Email: <input type="text" name="email"><br><br>
  Password: <input type="password" name="password"><br><br>
  <input type="submit" value="Submit">
</form> 

</body>
</html>
  1. display.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Display User Information</title>
</head>
<body>

<h1>Display User Information</h1>

<%
String name = request.getParameter("name");
String email = request.getParameter("email");
String password = request.getParameter("password");
%>

<p>Name: <%= name %></p>
<p>Email: <%= email %></p>
<p>Password: <%= password %></p>

</body>
</html>

In this example, the registration form is created in registration.jsp. The form has three fields for the user to enter their name, email, and password. When the user submits the form, the values entered by the user are sent to display.jsp via the POST method. In display.jsp, the values are retrieved from the request object using request.getParameter(name) and displayed on the page.



Further Reading

Understanding Enterprise Java Beans

Java Practice Exercise

programmingempire

Princites