
write a code for jsp file generator to generate a jsp page automatically taking html page as input

1)form.html:
<html> <form method="post" action="http://localhost:8080/examples/jsp/value.jsp"> <table> <tr><td>Name:</td><td><input type="text" name="name"></td></tr> <tr><td>Address:</td><td><input type="text" name="address"></td></tr> <tr><td>Contact No:</td><td><input type="text" name="contact"></td></tr> <tr><td>Email:</td><td><input type="text" name="email"></td></tr> <tr><td></td><td><input type="submit" value="Submit"></td></tr> </table> </form> </html>
2)value.jsp:
<%
String name=request.getParameter("name");
String address=request.getParameter("address");
int contact=Integer.parseInt(request.getParameter("contact"));
String email=request.getParameter("email");
out.println("Name is: "+name+"<br>");
out.println("Address is: "+address+"<br>");
out.println("Contact No is: "+contact+"<br>");
out.println("Email is: "+email);
%>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.