JSP
-------------------------------regiser.jsp--------------------------------------------------------
<!DOCTYPE html> <html> <head> <title>Consumer Registration</title> <link rel="stylesheet" type="text/css" href="CSS/styles.css"> </head> <body> <form action="RegisterServlet" method="post"> <label>Consumer ID:</label><input type="text" name="consumerId" maxlength="13" required><br> <label>Bill Number:</label><input type="text" name="billNumber" maxlength="5" required><br> <label>Title:</label> <select name="title"> <option>Mr.</option> <option>Ms.</option> <option>Mrs.</option> </select><br> <label>Customer Name:</label><input type="text" name="name" maxlength="50" required><br> <label>Email:</label><input type="email" name="email" required><br> <label>Mobile Number:</label> <select name="countryCode"> <option>+91</option> <option>+1</option> </select> <input type="text" name="mobile" maxlength="10" required><br> <label>User ID:</label><input type="text" name="userId" maxlength="20" required><br> <label>Password:</label><input type="password" name="password" maxlength="30" required><br> <label>Confirm Password:</label><input type="password" name="confirmPassword" maxlength="30" required><br> <button type="submit">Register</button> <button type="reset">Reset</button> </form> </body> </html>-------------------------------------------login.jsp
<!DOCTYPE html> <html> <head> <title>User Login</title> <link rel="stylesheet" type="text/css" href="CSS/Loginstyles.css"> </head> <body> <div class="container"> <h2>User Login</h2> <% if (request.getAttribute("errorMessage") != null) { %> <div class="error-message"> <%= request.getAttribute("errorMessage") %> </div> <% } %> <form action="LoginServlet" method="post"> <label>User ID:</label> <input type="text" name="userId" maxlength="20" required> <label>Password:</label>
<input type="password" name="password" maxlength="30" required>
<button type="submit">Login</button>
</form>
<p>Don't have an account? <a href="register.jsp">Register here</a></p>
</div>
</body>
</html>
----------------------------------------logout.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%
// Invalidate the current session if it exists
if (session != null) {
session.invalidate();
}
// Redirect to the login page
response.sendRedirect("login.jsp");
%>
-----------------------------------acknowledgment.jsp
<!DOCTYPE html> <html> <head> <title>Registration Successful</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div class="container"> <h3 class="success-message">Consumer Registration successful.</h3> <p><strong>Customer ID:</strong> ${consumerId}</p> <p><strong>Customer Name:</strong> ${customerName}</p> <p><strong>Email:</strong> ${email}</p> <a href="login.jsp">Login</a> </div> </body> </html>-------------------------------------home.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!-- Navbar at the top with Logout button on the same line -->
<nav>
<ul>
<li><a href="home.jsp">Home</a></li>
<li><a href="payBill.jsp">Pay Bill</a></li>
<li><a href="registerComplaint.jsp">Register Complaint</a></li>
<li><a href="complaintStatus.jsp">Complaint Status</a></li>
</ul>
<!-- Logout button placed at the right end of the navbar -->
<div class="logout">
<a href="logout.jsp">Logout</a>
</div>
</nav>
<h1>Welcome, <%= session.getAttribute("Name") %>!</h1>
</body>
</html>
---------------------------------------welcome.jsp
<!DOCTYPE html> <html> <head> <title>Welcome</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div class="container"> <h2>Welcome to Your Dashboard!</h2> <p>You're successfully logged in.</p> <a href="logout.jsp">Logout</a> </div> </body> </html>