A small, layered Java web application for managing a book list. It uses JSP, Java Servlets, plain Java business logic, and an in-memory repository to demonstrate traditional J2EE architecture without adding a framework or database.
Live demo: Deploy the repository using the Render Blueprint. Once the service is created, add its generated onrender.com URL here.
The demo is intentionally ephemeral. Books are held in memory and are cleared whenever the application restarts or is redeployed. Render's free web services can spin down after inactivity, so treat the hosted instance as a portfolio demonstration rather than a persistent service.
- Add a book with title, author, and ISBN
- Validate required fields and reject duplicate ISBN values
- View all books
- Search by title, author, or ISBN
- Edit a book's title and author
- Delete a book
- Preserve submitted values when add/edit validation fails
- Escape user-provided values before rendering them in JSP pages
Browser
-> JSP / HTML
-> Servlet
-> BookService
-> BookRepository
-> In-memory List<Book>
- Presentation: JSP pages and shared CSS
- Web: Servlets handle HTTP requests and responses
- Business:
BookServiceowns normalization, validation, CRUD operations, and search - Data:
BookRepositorymanages the in-memory collection - Lifecycle:
ApplicationContextListenercreates the shared service and stores it inServletContext
See Architecture for component responsibilities and request flows.
- Java 8
- JSP and Java Servlet 3.1 (
javax.servlet) - Apache Tomcat 9
- Maven WAR packaging
- Docker for repeatable deployment
- GitHub Actions for build verification
- JDK 8 or later
- Maven 3.8+
- Apache Tomcat 9 (for running the WAR)
Build the WAR:
mvn clean verifyThe deployable artifact is:
target/BookShelf.war
Copy it to Tomcat's webapps directory and start Tomcat. Open:
http://localhost:8080/BookShelf/
Build and start the Tomcat 9 container:
docker build -t bookshelf .
docker run --rm -p 10000:10000 bookshelfOpen http://localhost:10000/.
This repository includes a render.yaml Blueprint and a Dockerfile.
- Sign in to Render.
- Choose New and then Blueprint.
- Connect the
AAQIB-LOCAL/BookShelfGitHub repository. - Select the
mainbranch and apply thebookshelf-demoservice. - Wait for the Docker build and health check to complete.
- Copy the generated service URL into the Demo section above. Render may add a suffix if that service name is already taken.
The container runs Tomcat 9 on port 10000, matching Render's default web-service port. Render terminates HTTPS at its edge and forwards requests to the container over HTTP.
The repository uses a Java collection rather than a database. Data exists only in the running application process and is lost when that process restarts, the service scales to a new instance, or a new deployment replaces it. This is an intentional scope decision for this project.
The GitHub Actions workflow runs mvn clean verify for pushes and pull requests targeting main.