Files
struts2-demo/web/hello.jsp

125 lines
4.2 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello Action - Struts2 学习实验台</title>
<style>
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 {
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">
<div class="eyebrow">Hello Action</div>
<h1><s:property value="message" default="Hello from Struts2!"/></h1>
<p>这个页面用最短路径演示经典的 request -> action -> result 流程。你传入一个 name 参数Action 处理后再交给 JSP 结果页渲染。</p>
<div class="grid">
<section class="panel">
<h3>刚刚发生了什么</h3>
<p><s:property value="tip" default="The action populated a few view properties before returning SUCCESS."/></p>
</section>
<section class="panel">
<h3>建议下一步</h3>
<p><s:property value="nextStep" default="Open the login flow next."/></p>
</section>
<section class="panel">
<h3>再试一个请求</h3>
<p>你可以换一个查询参数,观察问候语如何跟着变化。</p>
<code><s:property value="requestSample" default="/hello?name=Platform%20Team"/></code>
</section>
<section class="panel">
<h3>当前输入</h3>
<p>name 参数值:<strong><s:property value="name" default="World"/></strong></p>
</section>
</div>
<div class="actions">
<a class="btn btn-primary" href="hello.action?name=Platform%20Team">用示例参数再运行一次</a>
<a class="btn btn-soft" href="loginPage.action">进入登录实验</a>
<a class="btn btn-soft" href="index.action">返回门户</a>
</div>
</div>
</body>
</html>