This is my Servlet:
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
String collectionName = request.getParameter("myCollectionName");
response.sendRedirect("index3.html");
String pattern = request.getParameter("Pattern");
String notPattern = request.getParameter("NotPattern");
}
}
This is my how my first html page looks like: https://i.stack.imgur.com/oFlQD.png
After the user clicks create, my web app redirects the user to the next page which looks like this:https://i.stack.imgur.com/UkfGd.png
I would like to use the value of Collection Name from my first html web page. In my second html page, I want the "Edit Collection" text box to have the same value as Collection Name from the first html page. How can I achieve this?
This is my first html file:
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Create New Collection</title>
<h><b>Create New Collection</b></h>
</head>
<body>
<form method="post" action='CollectionPath' >
<br>
Collection Name:<textarea name="myCollectionName" cols="10" rows="1"></textarea>
<br>
<br>
<input type="submit"
value="Create" style="color:white;background: blue" />
</form>
</body>
</html>
This is my second html file(index3.html)
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form method="post" action='CollectionPath' >
Edit Collection:
<textarea name="CollectionNameValue" cols="10" rows="1"></textarea>
<br>
<br>
<b>Include Content Matching the Following Patterns:</b>
<br>
<textarea name="pattern" cols="50" rows="10"></textarea>
<br>
example:http://www.mycompany.com/engineering/
<br>
<br>
<b>Do Not Include Content Matching the Following Patterns</b>:
<br>
<textarea name="notPattern" cols="50" rows="10"></textarea>
<br>
example:http://www.mycompany.com/engineering/
<br>
<input type="submit"
value="Save" style="color:white;background: blue"/>
</form>
</body>
</html>