I have a Servlet
that responds with a sendRedirect()
when there is a query GET
by the browser. In case there is one, the user is redirected to a second Form
.
The problem is with the security of the application. If I enter in the browser bar the address of the second Form
( localhost:8080/aplicacion/secondForm.html
) manages to avoid fulfilling the condition.
Thank you very much.
This is the Servlet
code:
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
String texto = request.getReader().readLine();
if (request.getMethod() == "GET"){
response.sendRedirect("secondForm.html");
} else {
out.print("Formulario Incompleto");
}