📄 struts-html.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>The Struts Framework Project - HTML Tags</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="Craig R. McClanahan" name="author" />
<meta content="Martin Cooper" name="author" />
<meta content="Mike Schachter" name="author" />
<meta content="James Turner" name="author" />
<meta content="David Graham" name="author" />
<link href="../struts.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="heading">
<a href="http://apache.org/">
<img id="asf_logo_wide" alt="The Apache Project" src="../images/asf_logo_wide.gif" />
</a>
<a href="http://struts.apache.org/">
<img id="struts-logo" alt="Struts Framework" src="../images/struts.gif" />
</a>
</div>
<!--end heading-->
<div id="content">
<div id="menu">
<p>User Guide</p>
<ul>
<li>
<a href="index.html">Table of Contents</a>
</li>
<li>
<a href="preface.html">Preface</a>
</li>
<li>
<a href="introduction.html">Introduction</a>
</li>
<li>
<a href="building_model.html">Model Components</a>
</li>
<li>
<a href="building_view.html">View Components</a>
</li>
<li>
<a href="building_controller.html">Controller Components</a>
</li>
<li>
<a href="configuration.html">Configuration</a>
</li>
<li>
<a href="release-notes.html">Release Notes</a>
</li>
<li>
<a href="installation.html">Installation</a>
</li>
</ul>
<p>Developer Guides</p>
<ul>
<li>
<a href="dev_bean.html">Bean Tags</a>
</li>
<li>
<a href="dev_html.html">HTML Tags</a>
</li>
<li>
<a href="dev_logic.html">Logic Tags</a>
</li>
<li>
<a href="dev_nested.html">Nested Tags</a>
</li>
<li>
<a href="dev_tiles.html">Tiles Tags</a>
</li>
<li>
<a href="dev_util.html">Utilities</a>
</li>
<li>
<a href="dev_validator.html">Validator</a>
</li>
</ul>
<p>Quick Links</p>
<ul>
<li>
<a href="../index.html">Welcome</a>
</li>
<li>
<a href="index.html">User and Developer Guides *</a>
</li>
<li>
<a href="../faqs/index.html">FAQs and HowTos</a>
</li>
</ul>
</div>
<!--end menu-->
<div id="main">
<h2 id="top">Page Construction Tags</h2>
<div class="indent">
<p>
This taglib contains tags used to create struts
input forms, as well as other tags generally useful
in the creation of HTML-based user interfaces.
</p>
<p>Many of the tags in this tag library will throw a
<code>JspException</code> at runtime when they are utilized incorrectly
(such as when you specify an invalid combination of tag attributes). JSP
allows you to declare an "error page" in the <code><%@ page %></code>
directive. If you wish to process the actual exception that caused the
problem, it is passed to the error page as a request attribute under key
<code>org.apache.struts.action.EXCEPTION</code>.</p>
<table class="taglib-summary">
<thead>
<tr>
<th>Tag Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">
<a href="#base">base</a>
</td>
<td>Render an HTML <base> Element</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#button">button</a>
</td>
<td>
Render A Button Input Field
</td>
</tr>
<tr class="evenRow">
<td align="center">
<a href="#cancel">cancel</a>
</td>
<td>
Render a Cancel Button
</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#checkbox">checkbox</a>
</td>
<td>
Render A Checkbox Input Field
</td>
</tr>
<tr class="evenRow">
<td align="center">
<a href="#errors">errors</a>
</td>
<td>
Conditionally display a set of accumulated error messages.
</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#file">file</a>
</td>
<td>
Render A File Select Input Field
</td>
</tr>
<tr class="evenRow">
<td align="center">
<a href="#form">form</a>
</td>
<td>
Define An Input Form
</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#frame">frame</a>
</td>
<td>Render an HTML frame element</td>
</tr>
<tr class="evenRow">
<td align="center">
<a href="#hidden">hidden</a>
</td>
<td>
Render A Hidden Field
</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#html">html</a>
</td>
<td>Render an HTML <html> Element</td>
</tr>
<tr class="evenRow">
<td align="center">
<a href="#image">image</a>
</td>
<td>
Render an input tag of type "image"
</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#img">img</a>
</td>
<td>Render an HTML img tag</td>
</tr>
<tr class="evenRow">
<td align="center">
<a href="#javascript">javascript</a>
</td>
<td>
Render JavaScript validation based on the
validation rules loaded by the ValidatorPlugIn.
</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#link">link</a>
</td>
<td>Render an HTML anchor or hyperlink</td>
</tr>
<tr class="evenRow">
<td align="center">
<a href="#messages">messages</a>
</td>
<td>
Conditionally display a set of accumulated messages.
</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#multibox">multibox</a>
</td>
<td>
Render A Checkbox Input Field
</td>
</tr>
<tr class="evenRow">
<td align="center">
<a href="#option">option</a>
</td>
<td>
Render A Select Option
</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#options">options</a>
</td>
<td>
Render a Collection of Select Options
</td>
</tr>
<tr class="evenRow">
<td align="center">
<a href="#optionsCollection">optionsCollection</a>
</td>
<td>
Render a Collection of Select Options
</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#password">password</a>
</td>
<td>
Render A Password Input Field
</td>
</tr>
<tr class="evenRow">
<td align="center">
<a href="#radio">radio</a>
</td>
<td>
Render A Radio Button Input Field
</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#reset">reset</a>
</td>
<td>
Render A Reset Button Input Field
</td>
</tr>
<tr class="evenRow">
<td align="center">
<a href="#rewrite">rewrite</a>
</td>
<td>Render an URI</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#select">select</a>
</td>
<td>
Render A Select Element
</td>
</tr>
<tr class="evenRow">
<td align="center">
<a href="#submit">submit</a>
</td>
<td>
Render A Submit Button
</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#text">text</a>
</td>
<td>
Render An Input Field of Type text
</td>
</tr>
<tr class="evenRow">
<td align="center">
<a href="#textarea">textarea</a>
</td>
<td>
Render A Textarea
</td>
</tr>
<tr class="oddRow">
<td align="center">
<a href="#xhtml">xhtml</a>
</td>
<td>Render HTML tags as XHTML</td>
</tr>
</table>
</div>
<h3 id="base">
<strong>base</strong> - Render an HTML <base> Element</h3>
<div class="indent">
<p>Renders an HTML <code><base></code> element with an
<code>href</code> attribute pointing to the absolute location of
the enclosing JSP page. This tag is valid only when nested inside
an HTML <code><head></code> element.</p>
<p>This tag is useful because it allows you to use relative URL
references in the page that are calculated based on the URL of the
page itself, rather than the URL to which the most recent submit
took place (which is where the browser would normally resolve
relative references against).</p>
<table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">target</td>
<td>
<p>The window target for this base reference.</p>
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">server</td>
<td>
<p>The server name to use instead of request.getServerName().</p>
[RT Expr]
</td>
</tr>
</table>
</div>
<p>
<a href="#top">Back to top</a>
</p>
<h3 id="button">
<strong>button</strong> -
Render A Button Input Field
</h3>
<div class="indent">
<p>
Renders an HTML <input> element of type
<code>button</code>, populated from the specified value or the
content of this tag body. This tag is only valid when nested
inside a form tag body.
</p>
<p>
If a graphical button is needed (a button with an image), then the
<a href="#image">
<code>image</code>
</a> tag is more appropriate.
</p>
<table class="tag-attributes">
<thead>
<tr>
<th class="attribute">Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tr class="evenRow">
<td align="center">accesskey</td>
<td>
The keyboard character used to move focus immediately to this
element.
[RT Expr]
</td>
</tr>
<tr class="oddRow">
<td align="center">alt</td>
<td>
<p>The alternate text for this element.</p>
[RT Expr]
</td>
</tr>
<tr class="evenRow">
<td align="center">altKey</td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -