Flow of the Student Management System Project
-
Frontend (JSP Pages) - signup.jsp: User signs up by entering their name, email, and password. The form data is sent via a POST request to the `Signupcontroller` servlet. - login.jsp: Users input their email and password. The form is submitted to the `Logincontroller` servlet for authentication. - display.jsp: Displays a table of all students' details, fetched after a successful login. It also provides links to delete or update each student's data. - edit.jsp: Displays a form with a student's current details, allowing the user to update them.
-
Servlet Controllers - Signupcontroller (`/signup`): - Handles the user registration form submission. - Data is retrieved from the signup form, converted into a `Student` object, and passed to the DAO for saving in the database. - On successful signup, the user is redirected to the login page. - **Logincontroller** (`/login`): - Handles the login process. - Verifies the credentials against the database. - If successful, retrieves all students and forwards the user to `display.jsp`. - If unsuccessful, redirects the user back to the login page. - Deletecontroller (`/delete`): - Deletes a student based on the provided ID. - Redirects to the updated list of students.
- Updatecontroller (`/update`): - Retrieves the student by ID and forwards the data to `edit.jsp` for modification. - Editcontroller (`/edit`): - Processes the updated data submitted from `edit.jsp`.
- Updates the database with the new student information.
-
DAO Layer (Studentdao Class) - `savestudent(Student student)`: Saves the student object to the database using JPA. - `loginStudent(String email)`: Fetches the student based on the email for login validation. - `updateStudent(Student student)`: Updates an existing student's details in the database. - `deletestudent(int id)`: Deletes the student record by its ID. - `getstudentbyid(int id)`: Retrieves a student's details by their ID. - `getallstudent()`: Fetches all students from the database.
-
Backend (JPA Entity) - Student.java: - Represents the `Student` entity. - Maps to a database table with fields like `id`, `name`, `email`, and `password`.
File Structure 1. `webapp` (JSP Frontend) - `signup.jsp`: Handles user signup. - `login.jsp`: Handles login. - `display.jsp`: Displays the list of students. - `edit.jsp`: Provides a form for editing student information.
2. studentmanagementsystem.controller (Servlets) - Signupcontroller.java: Handles signup logic. - Logincontroller.java: Manages user login. - Deletecontroller.java: Deletes a student. - Updatecontroller.java: Fetches the student for editing. - Editcontroller.java: Processes student updates.
3. studentmanagementsystem.dao (DAO Layer) - Studentdao.java: Handles database operations for the Student entity.
4. studentmanagementsystem.dto (Data Transfer Object) - Student.java: Represents the Student entity, with fields and methods to handle student data.
Summary:
Student Management System (Java, Servlets, JSP, Hibernate, MySQL) - Developed a web-based application for managing student records using Java Servlets, JSP, and Hibernate. - Implemented user authentication (login/signup) and CRUD functionalities (create, read, update, delete) for student data. - Integrated Hibernate ORM for database interactions and MySQL as the backend database. - Created a DAO layer for managing database operations, including student registration, login verification, updating student profiles, and deleting records. - Utilized JSP pages for user interface, displaying student data, and form submissions.