Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%--
- Document : index
- Created on : 01-04-2016, 11:00:30
- Author : aft_alumno
- --%>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <%! int cantidadIntentos = 0; %>
- <%
- String user_autorizado = "admin";
- String pass_autorizado = "123";
- String user = request.getParameter("user");
- String pass = request.getParameter("pass");
- String mensaje = "";
- if (user_autorizado.equals(user) && pass_autorizado.equals(pass)){
- mensaje = "Acceso Autorizado.";
- }else{
- mensaje = "Error de Acceso.";
- }
- %>
- <% if (user != null && pass != null) { %>
- <%= mensaje %>
- <%= "<p><h6>Intento nro: " + (++cantidadIntentos) + "</h6>" %>
- <% } %>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>JSP Page</title>
- </head>
- <body>
- <h1>Formulario</h1>
- <form name="ingreso" method="post" action="">
- <fieldset>
- <legend>Ingreso de Usuario</legend>
- <table width="400" border="0">
- <tr><td>Usuario:</td><td><input type="text" name="user"></td></tr>
- <tr><td>Password:</td><td><input type="password" name="pass"></td></tr>
- </table>
- <input type="submit">
- </fieldset>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement