GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - UCLComputerScience/COMP0004HelloWorldWebExample

BranchesTags
Open more actions menu

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
src/main
src/main
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Java Web App (Servlet) Starter

A minimal Maven-based Java web application used for COMP0004. This project is aimed at junior developers who are learning how a basic Java web app is structured and how to run it locally.

What you are looking at

  • Java + Servlet API: A simple servlet handles HTTP requests.
  • Maven: Manages dependencies, compilation, and packaging.
  • WAR file: The web app is packaged as a .war for deployment to a servlet container (like Tomcat).

Prerequisites

  • JDK 8+ installed and java/javac on your PATH
  • Maven 3+ installed and mvn on your PATH

Check versions:

java -version
mvn -version

Project layout (high level)

.
├── pom.xml                  # Maven build config
├── src/
│   └── main/
│       ├── java/             # Java source code
│       └── webapp/           # Web resources (WEB-INF, web.xml, etc.)
└── target/                   # Build output (generated)

Build (compile + package)

From the project root:

mvn clean package

This will:

  • Compile your Java code
  • Run tests (if any)
  • Create a WAR file in target/

Run locally (preferred: embedded Tomcat via Maven)

The easiest way to run this project is through Maven using the embedded Tomcat setup. This is the preferred method because Maven will download and manage the required dependencies automatically.

From the project root:

mvn clean package
mvn exec:exec

Then open:

http://localhost:8080/

Tip: Keep the terminal running while the server is up. Stop it with Ctrl+C.

Run locally (using an external container)

This project packages a WAR, so you run it in a servlet container such as Tomcat.

  1. Build the WAR:
mvn clean package
  1. Copy the WAR to Tomcat’s webapps/ folder:
cp target/*.war /path/to/tomcat/webapps/
  1. Start Tomcat (example):
/path/to/tomcat/bin/startup.sh
  1. Open your browser:
http://localhost:8080/

Tip: Tomcat will deploy the WAR automatically when it appears in webapps/.

Useful Maven commands

  • mvn clean — remove old build output
  • mvn compile — compile the code only
  • mvn test — run tests
  • mvn package — build the WAR

Common issues

  • Port already in use: Another service is using 8080. Stop it or change Tomcat’s port.
  • Missing Java: Ensure JAVA_HOME is set and java -version works.
  • Maven not found: Install Maven and ensure mvn is on your PATH.

Next steps for learning

  • Add another servlet and map it in web.xml
  • Explore request parameters and responses
  • Try a simple HTML form and process it in a servlet

If you’re new to Java web apps, focus on the build/run cycle first: edit → mvn package → deploy WAR → refresh browser.

About

No description, website, or topics provided.

Resources

Readme
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

7 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.