<%@ page contentType="text/html;charset=UTF-8" language="java" %> Struts2 Demo Lab
Struts2 Demo Lab

Turn scattered examples into a guided demo portal

This workspace now acts like a mini learning application instead of a pile of sample pages. You can jump into action basics, login flow, validation, uploads, and JSON demos from one place.

Live action routes5
Guide pages4
Demo forms3
JSON endpoints2
Core lab track4
Completed labs0
Request lifecycle

How to explain Struts2 with one mental model

1. Request enters

The browser sends a URL and optional form fields or query params.

2. Action mapping

struts.xml resolves the action name and target class.

3. Parameter binding

Struts populates action properties before execute() runs.

4. Result routing

The returned result name decides which JSP or JSON renderer will respond.

Catalog

Interactive demos and guides

Action Beginner

Hello action

Run a real Struts action, inject a request parameter, and inspect the rendered result page.

Form Core flow

Login flow

Use demo credentials, see field validation, and land on a richer post-login dashboard.

Action Form submit

User intake form

Submit a small profile payload and see action-backed validation with a success summary.

Validation Teaching

Validation demo

Test length, email, age, and text limits while keeping the page readable for explanation.

Upload Safe demo

Upload metadata demo

Capture file metadata through Struts form binding without writing anything to disk.

JSON API style

AJAX and REST payloads

Show how Struts2 can return JSON from actions for AJAX examples and lightweight REST-style demos.

Guide Patterns

Model binding guide

Compare property-driven and model-driven input binding to explain how Struts builds action state.

Learning pipeline

Suggested order for the full demo

1. Start with hello

See the smallest action and result mapping first.

2. Move to forms

Login and user intake show parameter binding in action.

3. Validate inputs

Explain field errors, business rules, and success pages.

4. Expand to JSON

Close the session with AJAX and REST-style payload demos.