WeDice
Overview
This project is a simple dice game implemented using Java EE (Jakarta EE) concepts and tools. The game allows users to log in, play a dice game, and view their scores. It showcases the use of servlets, filters, sessions, and JSPs in a dynamic web application.
Features
- User Authentication: Users log in to access the game.
- Game Logic: Users roll dice, and scores are calculated based on predefined rules.
- Session Management: Sessions maintain user login states, game states, and scores.
- Error Handling: Robust error handling with friendly user messages.
- Input Validation: Ensures data integrity and prevents errors.
- Dynamic Content: JSPs generate HTML content based on user actions.
Technical Details
-
Servlets BestScoreServlet: Displays the best scores. DeconnectServlet: Handles user logout. GameServlet: Manages game actions and score updates. LoginServlet: Manages user login. NewGameServlet: Starts a new game . ReinitGameServlet: Resets the current game. UserManagementServlet: Manages user registration and updates.
-
Filters ExceptionFilter: Logs and handles exceptions, forwarding to an error page. SecurityFilter: Ensures only authenticated users access protected resources. UserValidationFilter: Validates user input for registration and updates.
-
Sessions Session Management: Maintains user-specific data and game state.
-
JSPs and Frontend LoginForm.jsp: User login interface. GamePage.jsp: Main game interface for rolling dice and viewing scores. ScorePage.jsp: Displays scores. Error.jsp: Shows error messages.
How It Works
1- Registration and Login: Users register and log in using UserManagementServlet and LoginServlet.