FoundIt is a Java web application for a college office to record lost items and let students check which items are still available. The project is designed as a small, practical demo of a lost-and-found workflow using Java servlets, JSP, and MySQL.
- Open the app and go to Staff Login.
- Sign in with the configured staff account.
- Add a lost item with:
- item name
- photo
- where it was found
- who handed it in
- date found
- View the dashboard of all recorded items.
- Mark an item as collected once it has been returned.
- Open the home page.
- Use the "View Available Items" option.
- Browse the currently uncollected items.
- Visit the college office to claim the item.
- Staff-only dashboard protected by a servlet session check
- Secure login for staff using the
stafftable - Image upload support for lost items
- Item status tracking:
AVAILABLEandCOLLECTED - Guest browsing of only available items
- Built-in deployment scripts for local Tomcat setup
- Java 21
- Jakarta Servlet API
- JSP
- JDBC
- MySQL
- Apache Tomcat 10.1
- HTML and CSS
- VS Code with Java support
No Maven is required for this project.
FoundIt/
├── database/
│ └── schema.sql
├── src/
│ └── com/foundit/
│ ├── filter/
│ │ └── StaffAuthFilter.java
│ ├── model/
│ │ └── Item.java
│ ├── servlet/
│ │ ├── AddItemServlet.java
│ │ ├── CollectItemServlet.java
│ │ ├── GuestItemsServlet.java
│ │ ├── StaffDashboardServlet.java
│ │ ├── StaffLoginServlet.java
│ │ └── StaffLogoutServlet.java
│ └── util/
│ └── DBConnection.java
├── WebContent/
│ ├── WEB-INF/
│ │ ├── classes/
│ │ ├── lib/
│ │ ├── web.xml
│ │ └── views/
│ │ ├── add-item.jsp
│ │ ├── guest-items.jsp
│ │ └── staff-dashboard.jsp
│ ├── css/
│ │ └── style.css
│ ├── index.jsp
│ ├── staff-login.jsp
│ └── uploads/
├── build.bat
├── deploy.bat
├── README.md
└── .gitignore
Install the following before running the app:
- JDK 21
- Apache Tomcat 10.1
- MySQL 8.4+
- VS Code with Java support
- MySQL Connector/J JAR
Run the SQL script in:
database/schema.sql
This creates the foundit_db database, the staff and items tables, and inserts the demo staff account:
Username: staff
Password: foundit123
If you are using this for anything beyond a demo, change the default credentials.
Open:
src/com/foundit/util/DBConnection.java
Update the username and password to match your MySQL installation:
private static final String USER = "root";
private static final String PASSWORD = "YOUR_MYSQL_PASSWORD";Download the connector from:
https://dev.mysql.com/downloads/connector/j/
Copy the JAR into:
WebContent/WEB-INF/lib/
The folder accepts any file matching:
mysql-connector-j-*.jar
The helper scripts expect Tomcat at:
C:\Program Files (x86)\Apache Software Foundation\Tomcat 10.1
If your installation is elsewhere, update the TOMCAT path in both build.bat and deploy.bat.
From the project root, run:
build.batThis compiles the Java classes into:
WebContent/WEB-INF/classes
Run:
deploy.batThis script:
- builds the application
- copies the web app to Tomcat
- backs up the
uploadsdirectory before redeploy - starts Tomcat and opens the app in the browser
Once deployment is complete, open:
http://localhost:8080/FoundIt/
If the browser does not open automatically, you can start Tomcat manually with:
"C:\Program Files (x86)\Apache Software Foundation\Tomcat 10.1\bin\startup.bat"The login form posts the username and password to StaffLoginServlet. The servlet checks the staff table and creates a session when the credentials match.
StaffAuthFilter blocks access to staff-only pages unless a valid staffUser session exists.
AddItemServlet validates the form fields and uploaded image, saves the image to the app's uploads folder, and inserts the item into the MySQL items table with status AVAILABLE.
StaffDashboardServlet loads all items and shows them in reverse order of insertion. Staff can mark a record as collected from the dashboard.
GuestItemsServlet selects only records with status = 'AVAILABLE'.
CollectItemServlet updates an item from AVAILABLE to COLLECTED when the staff clicks the action button.
The demo account created by the SQL script is:
Username: staff
Password: foundit123
Uploaded photos are stored in the application's uploads directory and are referenced from the JSP pages using their file names. The deployment script backs up existing uploads before replacing the application and restores them after deployment so photos are not lost during a redeploy.
This project is a simple academic/demo-type lost-and-found system. It is intentionally lightweight and does not include advanced user roles, messaging, claims workflows, or production-grade security features.