Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(username.equals(username)&&(password.equalsIgnoreCase(password))
- <form method="POST" action="j_security_check">
- <table cellpadding="0" cellspasing="0" border="0">
- <tr>
- <td align="right">Username: </td>
- <td>
- <input type="text" name="j_username">
- </td>
- </tr>
- <tr>
- <td align="right">Password: </td>
- <td>
- <input type="password" name="j_password">
- </td>
- </tr>
- <tr>
- <td></td>
- <td><input type="submit" value="Login"</td>
- </tr>
- </table>
- </form>
- <title>Login Error</title>
- </head>
- <body>
- There was an error logging in. Please try again.
- </body>
- <body>
- <h2>Admin Page</h2>
- <p>
- Had this been a real admin page, you would have
- been able to administer the system from here!
- </p>
- </body>
- String username = request.getParameter("j_username");
- String password = request.getParameter("j_password");
- RequestDispatcher rd = null;
- if (username.equals(username) && password.equalsIgnoreCase(password)) {
- rd = request.getRequestDispatcher("/success.jsp");
- User user = new User(username, password);
- request.setAttribute("user", user);
- } else {
- rd = request.getRequestDispatcher("/error.jsp");
- }
- rd.forward(request, response);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement