blob: 277fb7de8d872cc95d30994cde5e54e0fc3fe759 [file] [log] [blame]
刘洪青6266f992017-05-15 21:21:03 +08001<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Apache Tomcat 7 (7.0.77) - Default Servlet Reference</title><meta name="author" content="Tim Funk"><style type="text/css" media="print">
2 .noPrint {display: none;}
3 td#mainBody {width: 100%;}
4</style><style type="text/css">
5code {background-color:rgb(224,255,255);padding:0 0.1em;}
6code.attributeName, code.propertyName {background-color:transparent;}
7
8
9table {
10 border-collapse: collapse;
11 text-align: left;
12}
13table *:not(table) {
14 /* Prevent border-collapsing for table child elements like <div> */
15 border-collapse: separate;
16}
17
18th {
19 text-align: left;
20}
21
22
23div.codeBox pre code, code.attributeName, code.propertyName, code.noHighlight, .noHighlight code {
24 background-color: transparent;
25}
26div.codeBox {
27 overflow: auto;
28 margin: 1em 0;
29}
30div.codeBox pre {
31 margin: 0;
32 padding: 4px;
33 border: 1px solid #999;
34 border-radius: 5px;
35 background-color: #eff8ff;
36 display: table; /* To prevent <pre>s from taking the complete available width. */
37 /*
38 When it is officially supported, use the following CSS instead of display: table
39 to prevent big <pre>s from exceeding the browser window:
40 max-width: available;
41 width: min-content;
42 */
43}
44
45div.codeBox pre.wrap {
46 white-space: pre-wrap;
47}
48
49
50table.defaultTable tr, table.detail-table tr {
51 border: 1px solid #CCC;
52}
53
54table.defaultTable tr:nth-child(even), table.detail-table tr:nth-child(even) {
55 background-color: #FAFBFF;
56}
57
58table.defaultTable tr:nth-child(odd), table.detail-table tr:nth-child(odd) {
59 background-color: #EEEFFF;
60}
61
62table.defaultTable th, table.detail-table th {
63 background-color: #88b;
64 color: #fff;
65}
66
67table.defaultTable th, table.defaultTable td, table.detail-table th, table.detail-table td {
68 padding: 5px 8px;
69}
70
71
72p.notice {
73 border: 1px solid rgb(255, 0, 0);
74 background-color: rgb(238, 238, 238);
75 color: rgb(0, 51, 102);
76 padding: 0.5em;
77 margin: 1em 2em 1em 1em;
78}
79</style></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img src="./images/tomcat.gif" align="right" alt="
Hongqing Liufd5ee812014-05-10 16:32:51 +080080 The Apache Tomcat Servlet/JSP Container
刘洪青6266f992017-05-15 21:21:03 +080081 " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 7</font></h1><font face="arial,helvetica,sanserif">Version 7.0.77, Mar 28 2017</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="./images/asf-logo.svg" align="right" alt="Apache Logo" border="0" style="width: 266px;height: 83px;"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap class="noPrint"><p><strong>Links</strong></p><ul><li><a href="index.html">Docs Home</a></li><li><a href="http://wiki.apache.org/tomcat/FAQ">FAQ</a></li><li><a href="#comments_section">User Comments</a></li></ul><p><strong>User Guide</strong></p><ul><li><a href="introduction.html">1) Introduction</a></li><li><a href="setup.html">2) Setup</a></li><li><a href="appdev/index.html">3) First webapp</a></li><li><a href="deployer-howto.html">4) Deployer</a></li><li><a href="manager-howto.html">5) Manager</a></li><li><a href="realm-howto.html">6) Realms and AAA</a></li><li><a href="security-manager-howto.html">7) Security Manager</a></li><li><a href="jndi-resources-howto.html">8) JNDI Resources</a></li><li><a href="jndi-datasource-examples-howto.html">9) JDBC DataSources</a></li><li><a href="class-loader-howto.html">10) Classloading</a></li><li><a href="jasper-howto.html">11) JSPs</a></li><li><a href="ssl-howto.html">12) SSL/TLS</a></li><li><a href="ssi-howto.html">13) SSI</a></li><li><a href="cgi-howto.html">14) CGI</a></li><li><a href="proxy-howto.html">15) Proxy Support</a></li><li><a href="mbeans-descriptors-howto.html">16) MBeans Descriptors</a></li><li><a href="default-servlet.html">17) Default Servlet</a></li><li><a href="cluster-howto.html">18) Clustering</a></li><li><a href="balancer-howto.html">19) Load Balancer</a></li><li><a href="connectors.html">20) Connectors</a></li><li><a href="monitoring.html">21) Monitoring and Management</a></li><li><a href="logging.html">22) Logging</a></li><li><a href="apr.html">23) APR/Native</a></li><li><a href="virtual-hosting-howto.html">24) Virtual Hosting</a></li><li><a href="aio.html">25) Advanced IO</a></li><li><a href="extras.html">26) Additional Components</a></li><li><a href="maven-jars.html">27) Mavenized</a></li><li><a href="security-howto.html">28) Security Considerations</a></li><li><a href="windows-service-howto.html">29) Windows Service</a></li><li><a href="windows-auth-howto.html">30) Windows Authentication</a></li><li><a href="jdbc-pool.html">31) Tomcat's JDBC Pool</a></li><li><a href="web-socket-howto.html">32) WebSocket</a></li></ul><p><strong>Reference</strong></p><ul><li><a href="RELEASE-NOTES.txt">Release Notes</a></li><li><a href="config/index.html">Configuration</a></li><li><a href="api/index.html">Tomcat Javadocs</a></li><li><a href="servletapi/index.html">Servlet Javadocs</a></li><li><a href="jspapi/index.html">JSP 2.2 Javadocs</a></li><li><a href="elapi/index.html">EL 2.2 Javadocs</a></li><li><a href="websocketapi/index.html">WebSocket 1.1 Javadocs</a></li><li><a href="http://tomcat.apache.org/connectors-doc/">JK 1.2 Documentation</a></li></ul><p><strong>Apache Tomcat Development</strong></p><ul><li><a href="building.html">Building</a></li><li><a href="changelog.html">Changelog</a></li><li><a href="http://wiki.apache.org/tomcat/TomcatVersions">Status</a></li><li><a href="developers.html">Developers</a></li><li><a href="architecture/index.html">Architecture</a></li><li><a href="funcspecs/index.html">Functional Specs.</a></li><li><a href="tribes/introduction.html">Tribes</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>Default Servlet Reference</h1><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote>
Hongqing Liufd5ee812014-05-10 16:32:51 +080082<ul><li><a href="#what">What is the DefaultServlet</a></li><li><a href="#where">Where is it declared?</a></li><li><a href="#change">What can I change?</a></li><li><a href="#dir">How do I customize directory listings?</a></li><li><a href="#secure">How do I secure directory listings?</a></li></ul>
83</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="what"><strong>What is the DefaultServlet</strong></a></font></td></tr><tr><td><blockquote>
刘洪青6266f992017-05-15 21:21:03 +080084<p>
Hongqing Liufd5ee812014-05-10 16:32:51 +080085The default servlet is the servlet which serves static resources as well
86as serves the directory listings (if directory listings are enabled).
刘洪青6266f992017-05-15 21:21:03 +080087</p>
Hongqing Liufd5ee812014-05-10 16:32:51 +080088</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="where"><strong>Where is it declared?</strong></a></font></td></tr><tr><td><blockquote>
刘洪青6266f992017-05-15 21:21:03 +080089<p>
Hongqing Liufd5ee812014-05-10 16:32:51 +080090It is declared globally in <i>$CATALINA_BASE/conf/web.xml</i>.
91By default here is it's declaration:
刘洪青6266f992017-05-15 21:21:03 +080092</p>
93<div class="codeBox"><pre><code> &lt;servlet&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +080094 &lt;servlet-name&gt;default&lt;/servlet-name&gt;
95 &lt;servlet-class&gt;
96 org.apache.catalina.servlets.DefaultServlet
97 &lt;/servlet-class&gt;
98 &lt;init-param&gt;
99 &lt;param-name&gt;debug&lt;/param-name&gt;
100 &lt;param-value&gt;0&lt;/param-value&gt;
101 &lt;/init-param&gt;
102 &lt;init-param&gt;
103 &lt;param-name&gt;listings&lt;/param-name&gt;
刘洪青6266f992017-05-15 21:21:03 +0800104 &lt;param-value&gt;false&lt;/param-value&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800105 &lt;/init-param&gt;
106 &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
107 &lt;/servlet&gt;
108
109...
110
111 &lt;servlet-mapping&gt;
112 &lt;servlet-name&gt;default&lt;/servlet-name&gt;
113 &lt;url-pattern&gt;/&lt;/url-pattern&gt;
刘洪青6266f992017-05-15 21:21:03 +0800114 &lt;/servlet-mapping&gt;</code></pre></div>
Hongqing Liufd5ee812014-05-10 16:32:51 +0800115
116So by default, the default servlet is loaded at webapp startup and
刘洪青6266f992017-05-15 21:21:03 +0800117directory listings are disabled and debugging is turned off.
Hongqing Liufd5ee812014-05-10 16:32:51 +0800118</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="change"><strong>What can I change?</strong></a></font></td></tr><tr><td><blockquote>
刘洪青6266f992017-05-15 21:21:03 +0800119<p>
120 The DefaultServlet allows the following initParamters:
121</p>
Hongqing Liufd5ee812014-05-10 16:32:51 +0800122
刘洪青6266f992017-05-15 21:21:03 +0800123<table border="1" cellpadding="5"><tr><th width="15%" bgcolor="#023264"><font color="#ffffff">Property</font></th><th width="85%" bgcolor="#023264"><font color="#ffffff">Description</font></th></tr><tr><td align="left" valign="center"><code class="propertyName">debug</code></td><td align="left" valign="center">
Hongqing Liufd5ee812014-05-10 16:32:51 +0800124 Debugging level. It is not very useful unless you are a tomcat
125 developer. As
刘洪青6266f992017-05-15 21:21:03 +0800126 of this writing, useful values are 0, 1, 11, 1000. [0]
127 </td></tr><tr><td align="left" valign="center"><code class="propertyName">listings</code></td><td align="left" valign="center">
Hongqing Liufd5ee812014-05-10 16:32:51 +0800128 If no welcome file is present, can a directory listing be
129 shown?
刘洪青6266f992017-05-15 21:21:03 +0800130 value may be <b>true</b> or <b>false</b> [false]
Hongqing Liufd5ee812014-05-10 16:32:51 +0800131 <br>
132 Welcome files are part of the servlet api.
133 <br>
134 <b>WARNING:</b> Listings of directories containing many entries are
135 expensive. Multiple requests for large directory listings can consume
136 significant proportions of server resources.
刘洪青6266f992017-05-15 21:21:03 +0800137 </td></tr><tr><td align="left" valign="center"><code class="propertyName">readmeFile</code></td><td align="left" valign="center">
Hongqing Liufd5ee812014-05-10 16:32:51 +0800138 If a directory listing is presented, a readme file may also
139 be presented with the listing. This file is inserted as is
刘洪青6266f992017-05-15 21:21:03 +0800140 so it may contain HTML.
141 </td></tr><tr><td align="left" valign="center"><code class="propertyName">globalXsltFile</code></td><td align="left" valign="center">
Hongqing Liufd5ee812014-05-10 16:32:51 +0800142 If you wish to customize your directory listing, you
Hongqing Liu71898292014-10-15 13:31:32 +0800143 can use an XSL transformation. This value is a relative file name (to
144 either $CATALINA_BASE/conf/ or $CATALINA_HOME/conf/) which will be used
145 for all directory listings. This can be overridden per context and/or
146 per directory. See <strong>contextXsltFile</strong> and
147 <strong>localXsltFile</strong> below. The format of the xml is shown
148 below.
刘洪青6266f992017-05-15 21:21:03 +0800149 </td></tr><tr><td align="left" valign="center"><code class="propertyName">contextXsltFile</code></td><td align="left" valign="center">
Hongqing Liufd5ee812014-05-10 16:32:51 +0800150 You may also customize your directory listing by context by
Hongqing Liu71898292014-10-15 13:31:32 +0800151 configuring <code>contextXsltFile</code>. This must be a context
152 relative path (e.g.: <code>/path/to/context.xslt</code>) to a file with
153 a <code>.xsl</code> or <code>.xslt</code> extension. This overrides
154 <code>globalXsltFile</code>. If this value is present but a file does
155 not exist, then <code>globalXsltFile</code> will be used. If
Hongqing Liufd5ee812014-05-10 16:32:51 +0800156 <code>globalXsltFile</code> does not exist, then the default
157 directory listing will be shown.
刘洪青6266f992017-05-15 21:21:03 +0800158 </td></tr><tr><td align="left" valign="center"><code class="propertyName">localXsltFile</code></td><td align="left" valign="center">
Hongqing Liufd5ee812014-05-10 16:32:51 +0800159 You may also customize your directory listing by directory by
Hongqing Liu71898292014-10-15 13:31:32 +0800160 configuring <code>localXsltFile</code>. This must be a file in the
161 directory where the listing will take place to with a
162 <code>.xsl</code> or <code>.xslt</code> extension. This overrides
163 <code>globalXsltFile</code> and <code>contextXsltFile</code>. If this
164 value is present but a file does not exist, then
165 <code>contextXsltFile</code> will be used. If
Hongqing Liufd5ee812014-05-10 16:32:51 +0800166 <code>contextXsltFile</code> does not exist, then
167 <code>globalXsltFile</code> will be used. If
168 <code>globalXsltFile</code> does not exist, then the default
169 directory listing will be shown.
刘洪青6266f992017-05-15 21:21:03 +0800170 </td></tr><tr><td align="left" valign="center"><code class="propertyName">input</code></td><td align="left" valign="center">
Hongqing Liufd5ee812014-05-10 16:32:51 +0800171 Input buffer size (in bytes) when reading
172 resources to be served. [2048]
刘洪青6266f992017-05-15 21:21:03 +0800173 </td></tr><tr><td align="left" valign="center"><code class="propertyName">output</code></td><td align="left" valign="center">
Hongqing Liufd5ee812014-05-10 16:32:51 +0800174 Output buffer size (in bytes) when writing
175 resources to be served. [2048]
刘洪青6266f992017-05-15 21:21:03 +0800176 </td></tr><tr><td align="left" valign="center"><code class="propertyName">readonly</code></td><td align="left" valign="center">
Hongqing Liufd5ee812014-05-10 16:32:51 +0800177 Is this context "read only", so HTTP commands like PUT and
178 DELETE are rejected? [true]
刘洪青6266f992017-05-15 21:21:03 +0800179 </td></tr><tr><td align="left" valign="center"><code class="propertyName">fileEncoding</code></td><td align="left" valign="center">
Hongqing Liufd5ee812014-05-10 16:32:51 +0800180 File encoding to be used when reading static resources.
181 [platform default]
刘洪青6266f992017-05-15 21:21:03 +0800182 </td></tr><tr><td align="left" valign="center"><code class="propertyName">sendfileSize</code></td><td align="left" valign="center">
183 If the connector used supports sendfile, this represents the minimal
184 file size in KB for which sendfile will be used. Use a negative value
Hongqing Liufd5ee812014-05-10 16:32:51 +0800185 to always disable sendfile. [48]
刘洪青6266f992017-05-15 21:21:03 +0800186 </td></tr><tr><td align="left" valign="center"><code class="propertyName">useAcceptRanges</code></td><td align="left" valign="center">
Hongqing Liufd5ee812014-05-10 16:32:51 +0800187 If true, the Accept-Ranges header will be set when appropriate for the
188 response. [true]
刘洪青6266f992017-05-15 21:21:03 +0800189 </td></tr><tr><td align="left" valign="center"><code class="propertyName">showServerInfo</code></td><td align="left" valign="center">
190 Should server information be presented in the response sent to clients
191 when directory listing is enabled. [true]
192 </td></tr></table>
Hongqing Liufd5ee812014-05-10 16:32:51 +0800193</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="dir"><strong>How do I customize directory listings?</strong></a></font></td></tr><tr><td><blockquote>
194<p>You can override DefaultServlet with you own implementation and use that
195in your web.xml declaration. If you
196can understand what was just said, we will assume you can read the code
197to DefaultServlet servlet and make the appropriate adjustments. (If not,
198then that method isn't for you)
199</p>
200<p>
201You can use either <code>localXsltFile</code> or
202<code>globalXsltFile</code> and DefaultServlet will create
203an xml document and run it through an xsl transformation based
204on the values provided in <code>localXsltFile</code> and
205<code>globalXsltFile</code>. <code>localXsltFile</code> is first
206checked, followed by <code>globalXsltFile</code>, then default
207behaviors takes place.
208</p>
209
210<p>
211Format:
刘洪青6266f992017-05-15 21:21:03 +0800212</p>
213<div class="codeBox"><pre><code> &lt;listing&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800214 &lt;entries&gt;
215 &lt;entry type='file|dir' urlPath='aPath' size='###' date='gmt date'&gt;
216 fileName1
217 &lt;/entry&gt;
218 &lt;entry type='file|dir' urlPath='aPath' size='###' date='gmt date'&gt;
219 fileName2
220 &lt;/entry&gt;
221 ...
222 &lt;/entries&gt;
223 &lt;readme&gt;&lt;/readme&gt;
刘洪青6266f992017-05-15 21:21:03 +0800224 &lt;/listing&gt;</code></pre></div>
Hongqing Liufd5ee812014-05-10 16:32:51 +0800225<ul>
226 <li>size will be missing if <code>type='dir'</code></li>
227 <li>Readme is a CDATA entry</li>
228</ul>
刘洪青6266f992017-05-15 21:21:03 +0800229
230<p>
231 The following is a sample xsl file which mimics the default tomcat behavior:
Hongqing Liufd5ee812014-05-10 16:32:51 +0800232</p>
刘洪青6266f992017-05-15 21:21:03 +0800233<div class="codeBox"><pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800234
235&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
刘洪青6266f992017-05-15 21:21:03 +0800236 version="3.0"&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800237
刘洪青6266f992017-05-15 21:21:03 +0800238 &lt;xsl:output method="html" html-version="5.0"
239 encoding="UTF-8" indent="no"
240 doctype-system="about:legacy-compat"/&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800241
242 &lt;xsl:template match="listing"&gt;
243 &lt;html&gt;
244 &lt;head&gt;
245 &lt;title&gt;
246 Sample Directory Listing For
247 &lt;xsl:value-of select="@directory"/&gt;
248 &lt;/title&gt;
249 &lt;style&gt;
刘洪青6266f992017-05-15 21:21:03 +0800250 h1 {color : white;background-color : #0086b2;}
251 h3 {color : white;background-color : #0086b2;}
252 body {font-family : sans-serif,Arial,Tahoma;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800253 color : black;background-color : white;}
刘洪青6266f992017-05-15 21:21:03 +0800254 b {color : white;background-color : #0086b2;}
255 a {color : black;} HR{color : #0086b2;}
256 table td { padding: 5px; }
Hongqing Liufd5ee812014-05-10 16:32:51 +0800257 &lt;/style&gt;
258 &lt;/head&gt;
259 &lt;body&gt;
260 &lt;h1&gt;Sample Directory Listing For
261 &lt;xsl:value-of select="@directory"/&gt;
262 &lt;/h1&gt;
刘洪青6266f992017-05-15 21:21:03 +0800263 &lt;hr style="height: 1px;" /&gt;
264 &lt;table style="width: 100%;"&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800265 &lt;tr&gt;
刘洪青6266f992017-05-15 21:21:03 +0800266 &lt;th style="text-align: left;"&gt;Filename&lt;/th&gt;
267 &lt;th style="text-align: center;"&gt;Size&lt;/th&gt;
268 &lt;th style="text-align: right;"&gt;Last Modified&lt;/th&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800269 &lt;/tr&gt;
270 &lt;xsl:apply-templates select="entries"/&gt;
271 &lt;/table&gt;
272 &lt;xsl:apply-templates select="readme"/&gt;
刘洪青6266f992017-05-15 21:21:03 +0800273 &lt;hr style="height: 1px;" /&gt;
274 &lt;h3&gt;Apache Tomcat/8.0&lt;/h3&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800275 &lt;/body&gt;
276 &lt;/html&gt;
277 &lt;/xsl:template&gt;
278
279
280 &lt;xsl:template match="entries"&gt;
281 &lt;xsl:apply-templates select="entry"/&gt;
282 &lt;/xsl:template&gt;
283
284 &lt;xsl:template match="readme"&gt;
刘洪青6266f992017-05-15 21:21:03 +0800285 &lt;hr style="height: 1px;" /&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800286 &lt;pre&gt;&lt;xsl:apply-templates/&gt;&lt;/pre&gt;
287 &lt;/xsl:template&gt;
288
289 &lt;xsl:template match="entry"&gt;
290 &lt;tr&gt;
刘洪青6266f992017-05-15 21:21:03 +0800291 &lt;td style="text-align: left;"&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800292 &lt;xsl:variable name="urlPath" select="@urlPath"/&gt;
293 &lt;a href="{$urlPath}"&gt;
刘洪青6266f992017-05-15 21:21:03 +0800294 &lt;pre&gt;&lt;xsl:apply-templates/&gt;&lt;/pre&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800295 &lt;/a&gt;
296 &lt;/td&gt;
刘洪青6266f992017-05-15 21:21:03 +0800297 &lt;td style="text-align: right;"&gt;
298 &lt;pre&gt;&lt;xsl:value-of select="@size"/&gt;&lt;/pre&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800299 &lt;/td&gt;
刘洪青6266f992017-05-15 21:21:03 +0800300 &lt;td style="text-align: right;"&gt;
301 &lt;pre&gt;&lt;xsl:value-of select="@date"/&gt;&lt;/pre&gt;
Hongqing Liufd5ee812014-05-10 16:32:51 +0800302 &lt;/td&gt;
303 &lt;/tr&gt;
304 &lt;/xsl:template&gt;
305
刘洪青6266f992017-05-15 21:21:03 +0800306&lt;/xsl:stylesheet&gt;</code></pre></div>
Hongqing Liufd5ee812014-05-10 16:32:51 +0800307
308</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="secure"><strong>How do I secure directory listings?</strong></a></font></td></tr><tr><td><blockquote>
309Use web.xml in each individual webapp. See the security section of the
310Servlet specification.
311
刘洪青6266f992017-05-15 21:21:03 +0800312</blockquote></td></tr></table></td></tr><tr class="noPrint"><td width="20%" valign="top" nowrap class="noPrint"></td><td width="80%" valign="top" align="left"><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="comments_section" id="comments_section"><strong>Comments</strong></a></font></td></tr><tr><td><blockquote><p class="notice"><strong>Notice: </strong>This comments section collects your suggestions
313 on improving documentation for Apache Tomcat.<br><br>
314 If you have trouble and need help, read
315 <a href="http://tomcat.apache.org/findhelp.html">Find Help</a> page
316 and ask your question on the tomcat-users
317 <a href="http://tomcat.apache.org/lists.html">mailing list</a>.
318 Do not ask such questions here. This is not a Q&amp;A section.<br><br>
319 The Apache Comments System is explained <a href="./comments.html">here</a>.
320 Comments may be removed by our moderators if they are either
321 implemented or considered invalid/off-topic.</p><script type="text/javascript"><!--//--><![CDATA[//><!--
322 var comments_shortname = 'tomcat';
323 var comments_identifier = 'http://tomcat.apache.org/tomcat-7.0-doc/default-servlet.html';
324 (function(w, d) {
325 if (w.location.hostname.toLowerCase() == "tomcat.apache.org") {
326 d.write('<div id="comments_thread"><\/div>');
327 var s = d.createElement('script');
328 s.type = 'text/javascript';
329 s.async = true;
330 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
331 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
332 }
333 else {
334 d.write('<div id="comments_thread"><strong>Comments are disabled for this page at the moment.<\/strong><\/div>');
335 }
336 })(window, document);
337 //--><!]]></script></blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
338 Copyright &copy; 1999-2017, Apache Software Foundation
Hongqing Liufd5ee812014-05-10 16:32:51 +0800339 </em></font></div></td></tr></table></body></html>