feat: expand struts demo lab

This commit is contained in:
Codex
2026-03-18 18:12:20 +08:00
parent 1f60832445
commit fba7b0497f
25 changed files with 1847 additions and 1447 deletions

View File

@@ -1,47 +1,124 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>Hello - Struts2 Demo</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello Action - Struts2 Demo Lab</title>
<style>
body {
font-family: 'Segoe UI', sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
body {
margin: 0;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
font-family: "Aptos", "Segoe UI", "Microsoft YaHei", sans-serif;
background: linear-gradient(135deg, #1464c7 0%, #3f8df7 52%, #f68b1f 100%);
color: #122033;
}
.card {
background: white;
padding: 50px;
border-radius: 20px;
text-align: center;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
h1 {
color: #667eea;
font-size: 3em;
margin-bottom: 20px;
}
p { color: #666; font-size: 1.2em; }
.btn {
display: inline-block;
margin-top: 30px;
padding: 14px 40px;
background: #667eea;
color: white;
text-decoration: none;
width: min(860px, calc(100vw - 32px));
background: rgba(255,255,255,0.94);
border: 1px solid rgba(255,255,255,0.45);
border-radius: 30px;
padding: 30px;
box-shadow: 0 24px 60px rgba(0,0,0,0.24);
}
.eyebrow {
font-size: 12px;
letter-spacing: 0.12em;
text-transform: uppercase;
color: #1464c7;
font-weight: 800;
}
h1 {
margin: 12px 0;
font-size: 42px;
line-height: 1.12;
}
p {
margin: 0;
color: #53667d;
line-height: 1.9;
}
.grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 14px;
margin-top: 20px;
}
.panel {
padding: 18px;
border-radius: 20px;
background: #f6f9fd;
border: 1px solid #dbe5f0;
}
.panel h3 {
margin: 0 0 8px;
font-size: 18px;
}
.panel code {
display: inline-block;
margin-top: 8px;
padding: 4px 8px;
border-radius: 10px;
background: #e8f2ff;
color: #1464c7;
}
.actions {
display: flex;
gap: 10px;
flex-wrap: wrap;
margin-top: 24px;
}
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 12px 18px;
border-radius: 999px;
text-decoration: none;
font-weight: 700;
}
.btn-primary { background: #1464c7; color: #fff; }
.btn-soft { background: #e8f2ff; color: #1464c7; }
@media (max-width: 720px) {
.grid { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<div class="card">
<h1><s:property value="message" default="Hello World!"/></h1>
<p>Struts2 Action 执行成功!</p>
<a href="index.jsp" class="btn">返回首页</a>
<div class="eyebrow">Hello Action</div>
<h1><s:property value="message" default="Hello from Struts2!"/></h1>
<p>This page proves the classic request -> action -> result flow. It accepts a name parameter, prepares a response in the action, and renders it through the JSP view.</p>
<div class="grid">
<section class="panel">
<h3>What just happened</h3>
<p><s:property value="tip" default="The action populated a few view properties before returning SUCCESS."/></p>
</section>
<section class="panel">
<h3>Good next step</h3>
<p><s:property value="nextStep" default="Open the login flow next."/></p>
</section>
<section class="panel">
<h3>Try another request</h3>
<p>Use a custom query parameter to change the greeting.</p>
<code><s:property value="requestSample" default="/hello?name=Platform%20Team"/></code>
</section>
<section class="panel">
<h3>Current input</h3>
<p>Name value: <strong><s:property value="name" default="World"/></strong></p>
</section>
</div>
<div class="actions">
<a class="btn btn-primary" href="hello?name=Platform%20Team">Run again with sample name</a>
<a class="btn btn-soft" href="user/login.jsp">Open login demo</a>
<a class="btn btn-soft" href="index.jsp">Back to portal</a>
</div>
</div>
</body>
</html>
</html>