0% found this document useful (0 votes)
135 views1 page

User Login Validation Page

This JSP page checks if a user's login credentials are valid by calling methods on a LoginAccount bean stored in the session. If valid, it displays the username and password and stores the username in the session. Otherwise, it displays an error message.

Uploaded by

ErwinMacaraig
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views1 page

User Login Validation Page

This JSP page checks if a user's login credentials are valid by calling methods on a LoginAccount bean stored in the session. If valid, it displays the username and password and stores the username in the session. Otherwise, it displays an error message.

Uploaded by

ErwinMacaraig
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

home.

jsp
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> <jsp:useBean id="account" class="webbeans.LoginAccount" scope="session"> <jsp:setProperty name="account" property="*" /> </jsp:useBean>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> </head> <body> <% if(account.isValid()){ session.setAttribute("username",account.getUsername()); out.println("Your login credentials are: "); out.println("<br />Username: " + account.getUsername()); out.println("<br />Password: " + account.getPasswd()); } else { out.println("<h2>Wrong Username/Password</h2>"); } %> </body> </html>

You might also like