A web-based note management application built with Java, Servlets, and JSP. WebNote allows users to create, organize, search, and manage notes with rich content including text and images.
- Features
- Technologies
- Project Structure
- Prerequisites
- Installation
- Running the Application
- Usage
- API Endpoints
- Data Storage
- Development
- License
- Note Management: Create, edit, view, and delete notes with rich content
- Category Organization: Organize notes into custom categories
- Rich Content Support:
- Text content
- Image uploads
- URL attachments
- Search Functionality: Search notes by keyword and filter by category
- Persistent Storage: JSON-based file storage system
- Responsive Web Interface: Clean and intuitive user interface built with JSP
- Embedded Tomcat Server: Built-in server for easy deployment
- Java 23: Core programming language
- Apache Tomcat 11.0.4: Embedded web server
- JSP 4.0.1: Server-side templating
- Maven: Build automation and dependency management
- Jackson: JSON processing for data persistence
- Servlets: Backend request handling
- HTML/CSS: Frontend presentation
WebNote/
βββ src/
β βββ main/
β βββ java/uk/ac/ucl/
β β βββ main/
β β β βββ Main.java # Application entry point
β β βββ model/
β β β βββ Note.java # Note entity
β β β βββ NoteContent.java # Content model
β β β βββ NoteService.java # Business logic service
β β β βββ NoteRepository.java # Repository interface
β β β βββ JsonNoteRepository.java # JSON persistence implementation
β β β βββ NoteFactory.java # Note creation factory
β β β βββ NoteSearch.java # Search functionality
β β βββ servlets/
β β βββ CreateNoteServlet.java # Create new notes
β β βββ SaveNoteServlet.java # Save note updates
β β βββ NoteServlet.java # View note details
β β βββ SearchServlet.java # Search notes
β β βββ UploadImageServlet.java # Handle image uploads
β β βββ ManageCategory.java # Category management
β β βββ ... # Other servlets
β βββ webapp/
β βββ index.jsp # Home page
β βββ note.jsp # Note detail view
β βββ noteList.jsp # List all notes
β βββ search.jsp # Search page
β βββ searchResult.jsp # Search results
β βββ styles.css # Stylesheets
β βββ WEB-INF/
β βββ web.xml # Web application config
βββ data/
β βββ index.json # Note index
β βββ categoryCollection.json # Categories
β βββ notes/ # Individual note files
β βββ images/ # Uploaded images
βββ pom.xml # Maven configuration
βββ README.md # This file
- Java Development Kit (JDK) 23 or higher
- Apache Maven 3.6+
- Git (for cloning the repository)
-
Clone the repository
git clone https://github.com/spicyGrape/WebNote.git cd WebNote -
Build the project
mvn clean install
This will:
- Compile the Java source files
- Process resources
- Run tests (if any)
- Package the application as a WAR file in
war-file/directory
mvn exec:execmvn compile
java -cp target/classes uk.ac.ucl.main.MainThe application will start an embedded Tomcat server and be accessible at:
http://localhost:8080
To stop the server, press Ctrl+C in the terminal.
- Navigate to the home page
- Click "Create New" or go to
/createNote.html - Add a title and content (text, images, URLs)
- Save the note
- Create a new category from the category management page
- Assign notes to categories
- Filter notes by category
- Go to the Search page
- Enter keywords
- Optionally filter by category
- View matching results
- Open or create a note
- Use the image upload feature
- Images are stored in
data/images/
GET /noteList.html- View all notesGET /createNote.html- Create note formPOST /createNote- Create new noteGET /note.html?id={noteId}- View specific notePOST /saveNote- Save note updatesPOST /deleteNote- Delete note
POST /uploadImage- Upload imagePOST /uploadUrl- Add URL contentPOST /deleteContent- Delete note content
POST /manageCategory- Create/delete categoriesPOST /addRemoveNoteToCategory- Add/remove note from category
GET /search.html- Search pagePOST /search- Perform search
GET /image?fileName={fileName}- Serve uploaded images
WebNote uses a JSON-based file system for data persistence:
- index.json: Master index of all notes
- categoryCollection.json: Category definitions and note assignments
- notes/*.json: Individual note files with full content
- images/: Uploaded image files
All data is stored in the data/ directory at the project root.
mvn clean packageThis creates a WAR file in war-file/ that can be deployed to any servlet container.
Key configuration in pom.xml:
- Java version: 23
- Tomcat version: 11.0.4
- JSP version: 4.0.1
- Main class:
uk.ac.ucl.main.Main
Application logs are written to logfile.txt in the project root.
- This project was originally developed as coursework for COMP0004 Object-Oriented Programming at UCL
- The application uses an embedded Tomcat server for easy development and deployment
- Data is persisted as JSON files in the
data/directory
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is part of academic coursework. Please check with the repository owner for usage rights.
spicyGrape
- GitHub: @spicyGrape
Happy Note-Taking! π