Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Hostel Management System Advanced

Java 21 + JSP/Servlet + MySQL hostel management application for Student, Warden and Admin roles.

Working role flow

  1. /login authenticates against users.
  2. Student -> /student/dashboard
  3. Warden -> /warden/dashboard
  4. 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.

Main staff modules

  • 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.

Student backend connections

  • 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

Database

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

Eclipse / Tomcat

  1. Import as an existing Eclipse Dynamic Web Project.
  2. Configure a Tomcat 10.x runtime (Jakarta Servlet API).
  3. Ensure Java 21 is selected.
  4. 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-specific C:/Users/... path was removed.
  5. Run hostel_db.sql.
  6. Add the project to Tomcat and open the application root or /login.

Validation performed in this package

  • 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.

Important security note

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.

Final navigation fix

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).

About

Smart Hostel Management System – Java JSP/Servlet/MySQL

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages