?? requesttags.jsp
字號:
<%@ taglib uri="/WEB-INF/requesttags.tld" prefix="request" %>
<html>
<head>
<title>The Request Tags</title>
<link rel="stylesheet" href="/prizetagsdemo/stylesheet.css" type="text/css">
</head>
<body>
<h2>The Request Tags</h2>
<p>
The request tags makes it easy for an included page to<br/>
write the URI, URL or web app context path to its output stream. That way<br/>
you don't have to hardcode the URL's of pages that link back to themselves.<br/>
JSP pages containing either tabbed panes or trees usually link back to themselves.<br/>
The request tags gives you the following advantages:<br/>
</p>
<ol>
<li>If you include a JSP page inside another JSP page, and the included JSP<br/>
page needs to link back to the including page, this is easily done<br/>
using the request tags.<br/><br/>
</li>
<li>
If you forward to, or include, a JSP page from a Struts action <br/>
or Spring controller, and the JSP needs to link back to that<br/>
controller, then URI / URL is automatically pointing back<br/>
to the Struts action or Spring controller. Not to the JSP. <br/>
This is usually handy when using Tree Tag or Tabbed Pane Tag <br/>
with Struts or Spring.<br/><br/>
</li>
<li>
If you include the same JSP page in many different other JSP pages <br/>
(or Struts Actions or Spring Controllers), then the link back to <br/>
the including page or action will always point correctly to the url of the <br/>
including action or page.
</li>
</ol>
<table cellspacing="0" cellpadding="5" style="border: 1px solid black;">
<tr><td style="border-bottom: 1px solid black;"><b>Tag</b></td>
<td style="border-bottom: 1px solid black;"><b>Tag Code</b></td>
<td style="border-bottom: 1px solid black;"><b>Tag Output</b></td></tr>
<tr><td><b>Request URI</b></td>
<td><request:requestUri/></td>
<td><b><request:requestUri/></b></td>
</tr>
<tr><td><b>Request URL</b></td>
<td><request:requestUrl/></td>
<td><b><request:requestUrl/></b></td>
</tr>
<tr><td><b>Web App Context Path</b></td>
<td><request:webAppContextPath/></td>
<td><b><request:webAppContextPath/></b></td>
</tr>
<tr><td valign="top"><b>Parameter String</b></td>
<td valign="top"><request:parameterString/></td>
<td><b><request:parameterString/> (suffix=false)<br/>
<request:parameterString suffix="true"/> (suffix=true)</b></td>
</tr>
</table>
<p>
Try seeing the effect of the parameterString tag...<br/>
...<a href="<request:requestUri/>?param1=123&otherParam=abc">with request parameters</a><br/>
...<a href="<request:requestUri/>">without request parameters</a><br/>
</p>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -