Team Role: Kanishq Chasta — Member 3 (Backend Developer 1)
Layer: Controller & Security Layer (MVC Architecture)
Technologies: Java EE Servlets, Servlet Filters, HTTP Session Management, Concurrent Collections, XML Deployment Descriptors
This module is the security core of the application, implementing role-based access control, session lifecycle management, concurrent device locking, and core administrative controllers.
- Authentication & Session Lifecycle Controllers:
- Developed
LoginServlet.javaverifying Teacher and Student credentials against database DAOs and initializing secure HTTP sessions. - Implemented
LogoutServlet.javainvalidating sessions, clearing security contexts, and preventing browser cache re-entry.
- Developed
- Concurrent Session Control & Single Active Device Lock:
- Developed
ActiveSessionManager.javautilizing a thread-safeConcurrentHashMap<String, HttpSession>. - When a user logs in from another browser or device, their prior session is automatically invalidated and replaced. This prevents credential sharing, unauthorized multi-device access, and zombie session persistence.
- Developed
- Student Self-Registration Controller:
- Developed
RegisterServlet.javahandling student self-registration (action=register). - Validates RTU roll numbers, prevents duplicate accounts, and assigns students to active class sections. Explicitly disallows student registration as faculty to preserve institutional hierarchy.
- Developed
- Centralized Security Filter (
AccessControlFilter.java):- Intercepts all incoming requests across the application.
- Enforces Role-Based Access Control (RBAC): strictly protects administrative endpoints (
/students/*,/classes/*,/theory/addTheory.jsp,/experiments/addExperiment.jsp) and teacher-exclusive feedback audits (feedbackList.jsp,FeedbackServlet?action=list,FeedbackServlet?action=exportCsv). - Bypasses static resources (CSS, JS, images) and public authentication routes (
/login.jsp,/RegisterServlet,action=exp10_login,action=exp10_register).
- Student & Class Management Controllers:
- Implemented
StudentServlet.javaorchestrating full CRUD operations, searches, and class section associations. - Developed
ClassServlet.javamanaging academic sections and batches.
- Implemented
- Deployment Configuration (
web.xml):- Authored servlet mappings, filter chain definitions, error page handlers, and session timeout thresholds.
| File Path | Description |
|---|---|
src/main/java/com/javalab/servlet/LoginServlet.java |
Authenticates teacher & student credentials, initializes session |
src/main/java/com/javalab/servlet/LogoutServlet.java |
Terminates active session and cleans up user context |
src/main/java/com/javalab/servlet/RegisterServlet.java |
Controller for student self-registration with duplicate prevention |
src/main/java/com/javalab/util/ActiveSessionManager.java |
Thread-safe single active device session lock via ConcurrentHashMap |
src/main/java/com/javalab/filter/AccessControlFilter.java |
Centralized filter enforcing authentication and role-based route security |
src/main/java/com/javalab/servlet/StudentServlet.java |
Controller handling student listing, addition, editing, deletion, and searching |
src/main/java/com/javalab/servlet/ClassServlet.java |
Controller handling class section creation, retrieval, and deletion |
src/main/webapp/WEB-INF/web.xml |
Servlet mappings, filter configuration, and web deployment descriptor |
- Integration with Member 1 & 2 (Frontend Presentation):
- Receives authentication requests from
login.jspand dispatches session state toheader.jspfandindex.jsp. - Processes form actions from
studentList.jsp,addStudent.jsp,manageClasses.jsp, andfeedback.jsp(auth); redirects cleanly with status flash messages.
- Receives authentication requests from
- Integration with Member 5 (Database & Persistence):
- Invokes
TeacherDAO.javaandStudentDAO.javaduring login authentication and student registration. - Delegates relational CRUD actions to
ClassSectionDAO.javaandStudentDAO.java.
- Invokes
- Thread-Safe Concurrent Session Management:
- Implemented single active session tracking via
ConcurrentHashMapinActiveSessionManagerto eliminate duplicate logins and enforce strict exam integrity.
- Implemented single active session tracking via
- Declarative Interceptor Architecture:
- Implemented
AccessControlFilterutilizingjavax.servlet.Filterto intercept all inbound HTTP requests, guaranteeing zero unauthorized access to administrative resources.
- Implemented
- Role-Segregated Registration Gateway:
- Enforced student-only self-registration while locking faculty provisioning to database administrators, preventing privilege escalation.