This project is a simple Spring Boot application that serves as an Employee Management Portal. This project provides a variety of self-service actions for its users.
employee-management-service
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ └── example
│ │ │ ├── EmployeeManagementPortal.java
│ │ │ ├── controller
│ │ │ │ └── EmployeeController.java
│ │ │ ├── service
│ │ │ │ └── EmployeeService.java
│ │ │ └── repository
│ │ │ └── UserRepository.java
│ │ └── resources
│ │ ├── application.properties
│ │ └── templates
│ │ └── user.html
│ └── test
│ └── java
│ └── com
│ └── example
│ └── EmployeeManagementPortalTests.java
├── pom.xml
└── README.md
-
Database Queries:
- The application demonstrates how to construct and execute SQL queries with user input.
-
HTML Content Rendering:
- User input is rendered in web pages to show how data can be displayed dynamically.
-
External Resource Fetching:
- The application allows users to input a URL, which is then fetched by the server to demonstrate API integration capabilities.
- Java 11 or higher
- Maven
-
Clone the repository:
git clone <repository-url> cd employee-management-service -
Build the application:
mvn clean install -
Run the application:
mvn spring-boot:runTo run on a different port (e.g., 9090 instead of the default port):
mvn spring-boot:run -Dspring-boot.run.arguments=--server.port=9090Alternatively, you can use an environment variable:
SERVER_PORT=9090 mvn spring-boot:runTroubleshooting port conflicts:
If you see an error like "Port X is already in use", you can:
- Find and stop the process using the port:
lsof -i :PORT_NUMBER kill PROCESS_ID - Or modify the
server.portproperty inapplication.propertiesto use a different port
- Find and stop the process using the port:
-
Access the application at
http://localhost:9090(or whichever port you configured).
- Home Page: Go to
http://localhost:9090to access the main user interface with all features - H2 Database Console: Access
http://localhost:9090/h2-consoleto inspect the in-memory database- JDBC URL:
jdbc:h2:mem:testdb - Username:
sa - Password: (leave empty)
- JDBC URL:
- Database Queries:
http://localhost:9090/api/user-search?username=yourQueryHere - HTML Rendering:
http://localhost:9090/api/render-content?userInput=yourTextHere - URL Fetching:
http://localhost:9090/api/fetch-url?url=http://example.com