- Java-based Web Applications
- "Student Database Viewer" App
The repository contains the results of the Laboratory Trainings for the course "Java-based Web Applications" (2024) during studies at National Technical University "Kharkiv Polytechnic Institute".
The course provides knowledge to create, debug, and deploy web applications in Java, including Servlets, JSP, JSTL, Hibernate, Spring, authentication, session management, working with cookies, and sending emails through mail services; practice building and deploying web projects with client-server databases.
The system manages data for university applicants (entrants/abiturients) and students, with role-based access control to ensure secure CRUD operations on related entities.
The application uses a multi-layered architecture to handle user registration, login, data viewing/editing, and session timeouts. It interacts with a MySQL database and employs Thymeleaf for dynamic HTML rendering.
The project is structured as a series of incremental laboratory works (labs), each building on the previous one, to demonstrate progressive web development skills.
| Lab Training | Topic | Report | Score |
|---|---|---|---|
| Lab 1 | Exploring the Java technology stack for creating and deploying web applications using servlets and JSP | lab1-report.pdf | 100 |
| Lab 2 | Study of the principles of using Hibernate, JPA and HQL to access data in web applications | lab2-report.pdf | 100 |
| Lab 3 | Study of the principles of creating complex projects using Spring Boot, Spring Data, Thymeleaf | lab3-report.pdf | 100 |
| Lab 4 | Study of the principles of using Spring Security to implement authentication, authorization and session support | lab4-report.pdf | 100 |
| Lab 5 | Study of Java components for organizing email distribution | 100 |
- User Authentication & Registration: Secure login form with password hashing (BCrypt). Admin-only user creation; self-registration assigns "STUDENT_VIEWER" role.
- Role-Based Authorization:
- ADMIN: Full CRUD on all entities (users, entrants, students).
- ENTRANT_MANAGER: Full CRUD on entrants; read-only on students.
- STUDENT_MANAGER: Full CRUD on students; read-only on entrants.
- ENTRANT_VIEWER: Read-only on entrants.
- STUDENT_VIEWER: Read-only on students.
- Email notification: Automatic sending of an email with a link to reset the password to newly created users by the administrator. Sending an email to reset the password at the user's request.
- CRUD Operations: Create, read, update, delete for entrants, students, and users (with foreign key constraints).
- Data Management: Filtering, sorting, searching, and pagination for entity tables.
- Session Handling: Display logged-in user name/role; automatic logout after inactivity.
- Validation: Custom validators for fields (e.g., IDs, birthdays, usernames, emails).
- Frontend: Responsive UI with Bootstrap; Thymeleaf templates for dynamic content.
- Database Integration: MySQL schema with tables for entrants, students, and users (one-to-one relationship between entrants and students).
- Testing: JUnit tests for services and application functionality.
- Logging: Configured via Logback.
- Backend: Java 17, Spring Boot 3.x, Spring Security, Spring Data JPA, Hibernate ORM.
- Database: MySQL 8.0.30.
- Frontend: Thymeleaf, HTML5, CSS (Bootstrap 5.3), JavaScript.
- Build Tool: Maven (pom.xml with dependencies like Lombok, JUnit, etc.).
- Other: Lombok for boilerplate reduction, Custom annotations for validation.
- Java for core development.
- Servlets, JSP for initial web pages and dynamic content.
- Hibernate for object-relational mapping (ORM) and database interactions.
- Spring Boot for application framework, including dependency injection, MVC architecture, and RESTful services.
- Spring Data JPA for repository management.
- Spring Security for authentication, authorization, and session management.
- MySQL as the relational database.
- Maven for build automation.
- Tomcat as the web/application server.
- Thymeleaf / HTML, CSS, Bootstrap 5.3, JavaScript for frontend templating (replacing plain JSP in later stages).
- JUnit for unit testing CRUD operations.
The project follows a multi-layered architecture:
- Configuration
- Controller
- Model
- Repository
- Service
- Validation
- View and resources
The project architecture is shown below.

- Java 17+ JDK
- Maven 3.x
- MySQL 8.0+ (create a database named as per application.properties)
- IntelliJ IDEA or Eclipse (recommended for development)
- Clone the repository:
git clone https://github.com/yourusername/WebAppsRIVLab4.git cd WebAppsRIVLab4 - Configure the database:
- Update application.properties with your MySQL credentials (e.g., username, password, URL).
- Run the application to auto-generate tables via Hibernate (or import schema manually).
- Build the project:
mvn clean install - Run the application:
mvn spring-boot:run- Access at http://localhost:8080.
- Run unit tests:
mvn test - Covers CRUD operations for services.
The structure of the test sets is shown below.

Here is the fake user data for demo.
| Role | Username | Password | |
|---|---|---|---|
| ADMIN | shavlii_oleksii |
Password123!$ |
shavlii.oleksii@ntu.khpi.edu.ua |
| ENTRANT_MANAGER | burulka-liudmyla |
Password123!$ |
burulka.liudmyla@ntu.khpi.edu.ua |
| STUDENT_MANAGER | voloshkov-tymur |
Password123!$ |
voloshkov.tymur@ntu.khpi.edu.ua |
| ENTRANT_VIEWER | kulish.volodymyr |
Password123!$ |
kulish.volodymyr@cs.khpi.edu.ua |
| STUDENT_VIEWER | stepova.alina |
Password123!$ |
stepova.alina@cs.khpi.edu.ua |
Ethereal credentials for viewing sent emails:
- login:
wilmer.ankunding@ethereal.email - password:
GVDW5ZTPSSXuAnRh1y
- Login/Register:
- Visit
/loginfor authentication. - Admins can add users at
/users/add. - Self-register at
/register(assignsSTUDENT_VIEWERrole).
- Visit
- Home Page: Redirects based on role; displays navigation menu.
- Entity Management:
/entrants: View/edit applicants (access varies by role)./students: View/edit students./users: Manage users (ADMIN only).
- Search/Filter/Sort: Available on table views (e.g., search by name, filter by role).
- Logout: Automatic after inactivity (configurable in SecurityConfig).
Screenshots of results are below, showing interfaces for different roles.
- Registration Page with Entered Credentials for a New User

- Authentication Page with a Message About Successful Registration of a New User

- Authentication Page with Entered Credentials of a Registered User

- Home Page of the Web Application for a Registered Student Viewer

- Profile Page of a Registered User with the Student Viewer Role

- User Credentials Change Page

- User Credentials Change Page with a Message About Successful Update

- Re-authentication Page After Data Change with Updated Credentials for a Student Viewer

- Home Page for a User with Updated Credentials and the Student Viewer Role

- Students Table Page for a Student Viewer

- Authentication Page with Credentials of an Entrant Viewer

- Home Page of the Web Application for an Entrant Viewer

- Profile Page of an Entrant Viewer

- Entrants Table Page for an Entrant Viewer

- Authentication Page with Credentials of an Entrant Manager

- Home Page of the Web Application for an Entrant Manager

- Profile Page of an Entrant Manager

- Entrants Table Page for an Entrant Manager

- Entrant Editing Page by an Entrant Manager

- Students Table Page for an Entrant Manager

- Authentication Page with Credentials of a Student Manager

- Home Page of the Web Application for a Student Manager

- Profile Page of a Student Manager

- Entrants Table Page for a Student Manager

- Students Table Page for a Student Manager

- Student Editing Page by a Student Manager

- Authentication Page with Administrator Credentials

- Home Page of the Web Application for an Administrator

- Profile Page of an Administrator

- Page for Creating a New User by an Administrator

- User Editing Page by an Administrator with a Message About Successful Creation of a New User

- User Editing Page by an Administrator with a Message About Successful Update of Existing User Data

- Users Table Page for an Administrator

- User Deletion Page by an Administrator with a Confirmation Prompt

- Users Table Page for an Administrator with a Message About User Deletion

- Users Table Page for an Administrator with Applied Search, Filtering, and Sorting

© Inessa Repeshko. 2024



