Java 21 + JSP/Servlet + MySQL hostel management application for Student, Warden and Admin roles.
/loginauthenticates againstusers.- Student ->
/student/dashboard - Warden ->
/warden/dashboard - Admin ->
/admin/dashboard
Management screens use servlet/controller URLs rather than direct JSP navigation. Admin and Warden render their own JSP folders while sharing DAO/business logic.
- Students: list, create student account/profile, room allocation, deactivate student.
- Rooms: live room list, add room, update room status.
- Complaints: list all and update Pending/In Progress/Resolved/Rejected with remarks.
- Visitors: register visitor and check out.
- Leave requests: approve/reject with remarks.
- Attendance: daily bulk attendance marking.
- Notices: publish/delete notices.
- Mess/Food: add/edit weekly menu items.
- Fees: assign dues and view payment state.
- Warden messages: view student messages and send replies.
- Reports: live aggregate student/room/complaint/leave/attendance/visitor figures.
- Profile: update name/phone and change password.
- Admin Users & Wardens: create accounts, change roles, delete accounts.
- Dashboard:
/student/dashboard - Room:
/room - Complaints:
/complaint?action=student; submission posts to/complaint?action=submit - Fees:
/fee - Visitors:
/visitor - Profile:
/profile - Notices:
/notice - Contact Warden:
/contact
Run hostel_db.sql in MySQL 8.x. It creates hostel_db, all tables, seed data, and demo records.
Default seeded logins:
- Admin:
admin@hostel.com/admin123 - Warden:
warden@hostel.com/warden123 - Student:
rohan@student.com/student123 - Additional seeded students:
student01@hostel.com...student20@hostel.com/student123
The default JDBC values are:
- URL:
jdbc:mysql://localhost:3306/hostel_db?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC - User:
root - Password:
1234
You can override them without editing source:
- JVM:
-Dhostel.db.url=... -Dhostel.db.user=... -Dhostel.db.password=... - Environment:
HOSTEL_DB_URL,HOSTEL_DB_USER,HOSTEL_DB_PASSWORD
- Import as an existing Eclipse Dynamic Web Project.
- Configure a Tomcat 10.x runtime (Jakarta Servlet API).
- Ensure Java 21 is selected.
- The project now references the bundled MySQL connector at
src/main/webapp/WEB-INF/lib/mysql-connector-j-9.4.0.jar; the old machine-specificC:/Users/...path was removed. - Run
hostel_db.sql. - Add the project to Tomcat and open the application root or
/login.
- All model, DAO and utility Java sources compiled successfully with Java 21.
- All servlet sources compiled successfully against a Jakarta Servlet-compatible API surface.
- Servlet mappings and JSP dispatch targets were checked for missing management views.
- Warden/Admin demo-array pages were replaced with request/DAO-backed pages.
- Role-sensitive POST actions were restricted so students cannot call staff management actions directly.
A live browser/database smoke test still requires an actual MySQL server and Tomcat runtime; neither server is installed in the packaging environment.
The supplied database/project uses plain-text demo passwords because the original project and SQL seed do. For real deployment, migrate passwords to BCrypt/Argon2 and add CSRF protection before exposing the application publicly.
All student dashboard/module navigation uses application-context-safe URLs. Student feature links no longer depend on the browser's current JSP directory, preventing 404 errors when navigating from the dashboard. Data-backed modules continue to enter through their Servlets (/room, /mess, /complaint, /fee, /visitor, /attendance, /notice, /leave, /profile, /contact).