⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 webapp-tags.xtp

📁 RESIN 3.2 最新源码
💻 XTP
📖 第 1 页 / 共 5 页
字号:
<document><header>  <product>resin</product>  <title>Web Application: tags</title>  <version>Resin 3.0</version>  <description>  <p>Web applications are configured with the &lt;web-app> tag, which can occur in a number of places.</p>        <ul>          <li><var type="file">WEB-INF/web.xml</var> contains a top-level  web-app element.  It is the Servlet standard location for defining  things like servlet mappings and security roles.</li>          <li><var type="file">WEB-INF/resin-web.xml</var> is also used by  Resin and will override and supplement the configuration in <var type="file">WEB-INF/web.xml</var>.  Use it to specify Resin specific  configuration if you prefer to keep <var>WEB-INF/web.xml</var> strictly  conforming to the Servlet specification.</li>          <li>A web application can also be configured in the main Resin  configuration, and in this context <var>web-app</var> is a child of &lt;<a href="host-tags.xtp">host</a>&gt;.</li>  </ul>  </description></header><body><localtoc/><s1 title="See Also"><ul><li><a href="env-tags.xtp">Resources tags</a> for beans, components,databases, @Stateless and @Stateful EJBs, JMS queues, etc.</li><li><a href="resin-security.xtp">Security</a> for a full descriptionof Resin's authentication and authorization.</li><li><a href="rewrite-tags.xtp">Rewrite tags</a> for Resin's rewrite-dispatchrewriting.</li></ul></s1><defun title="&lt;access-log>"><parents>web-app</parents><p>&lt;access-log> configures a HTTP access log for an indivitualweb-app.  See <a href="host-tags.xtp#%3caccess-log%3d">access-log</a>in the &lt;host> tag for more information.</p></defun><defun title="&lt;active-wait-time>"><parents>web-app</parents><p>&lt;active-wait-time> sets a 503 busy timeout for requeststrying to access a restarting web-app.  If the timeout expiresbefore the web-app complete initialization, the request will returna 503 Busy HTTP response.</p><def title="&lt;active-wait-time> schema">element active-wait-time {  r_period-Type}</def></defun><defun title="&lt;allow-servlet-el>"><parents>web-app</parents><p>The &lt;allow-servlet-el> flag configures whether &lt;servlet>tags allow EL expressions in the init-param.</p><def title="&lt;allow-servlet-el> schema">element allow-servlet-el {  r_boolean-Type}</def></defun><defun title="&lt;archive-path>"><parents>web-app</parents><p>&lt;archive-path> configures the location of the web-app's .war file.In some configurations, the .war expansion might notuse the <var>webapps/</var> directory, but will still want automaticwar expantion.</p><def title="&lt;archive-path> schema">element archive-path {  r_path-Type}</def><example title="Example: resin.xml explicit archive location">&lt;resin xmlns="http://caucho.com/ns/resin">&lt;cluster id="">  &lt;host id="">    &lt;web-app id="/foo"             root-directory="/var/www/foo"             archive-path="/var/www/wars/foo.war"/>  &lt;/host>&lt;/cluster>&lt;/resin></example></defun><defun title="&lt;auth-constraint>" version="Servlet"><parents>security-constraint</parents><p>Requires that authenticated users fill the specified role.In Resin's JdbcAuthenticator, normal users are in the "user" role.Think of a role as a group of users.</p><p>The roles are defined by the authenticators (see <a href="resin-security.xtp">Resin security</a>).  When using Resin's &lt;management> authenticationas a default, the role name is <var>resin-admin</var>.  (See<a href="resin-admin.xtp">Resin management</a>.)</p><deftable-childtags><tr>  <th>Attribute</th>  <th>Description</th></tr><tr>  <td>role-name</td>  <td>Roles which are allowed to access the resource.</td></tr></deftable-childtags><def title="&lt;auth-constraint> schema">element auth-constraint {  description*,  role-name*}</def><p>The following example protects the /admin subdirectory of a web-appby requiring a user to logon with Resin's &lt;management> users, i.e.using the same requirement as /resin-admin.</p><example title="Example: WEB-INF/resin-web.xml auth constraints">&lt;web-app xmlns="http://caucho.com/ns/resin">  &lt;login uri="basic:"/>  &lt;security-constraint url-pattern="/admin/*">    &lt;auth-constraint role-name="resin-admin"/>  &lt;/security-constraint>&lt;/web-app></example></defun><defun title="&lt;cache-mapping>" version="Resin 1.1"><parents>web-app</parents>      <p>&lt;cache-mapping> specifies <var>max-age</var> and <var>Expires</var> times for cacheable pages.</p><p>See <a href="proxy-cache.xtp">caching</a> for more information.</p><p>&lt;cache-mapping> is intended to provide Expires times for pages thathave ETags or Last-Modified specified, but do not wish to hard-code themax-age timeout in the servlet.  For example, Resin's FileServlet relieson cache-mapping to set the expires times for static pages.  Usingcache-mapping lets cacheable pages be configured in a standard manner.</p><p>&lt;cache-mapping> does not automatically make pages cacheable.  Yourservlets must already set the <var>ETag</var> (or Last-Modified) headerto activate &lt;cache-mapping>.</p>      <deftable-childtags><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>expires</td>  <td>A time interval to be used for the HTTP Expires header.</td>  <td></td></tr><tr>  <td>max-age</td>  <td>A time interval to be used for the "Cache-Control max-age=xxx" header.max-age affects proxies and browsers.</td>  <td></td></tr><tr>  <td>s-max-age</td>  <td>A time interval to be used for the "Cache-Control s-max-age=xxx" header.s-max-age affects proxy caches (including Resin), but not browsers.</td>  <td></td></tr><tr><td>url-pattern</td>    <td>A pattern matching the url:<var>/foo/*</var>, <var>/foo</var>, or <var>*.foo</var></td>    <td></td></tr><tr><td>url-regexp</td>    <td>A regular expression matching the url</td>    <td></td></tr></deftable-childtags><p>The time interval defaults to seconds, but will allow other periods:</p><deftable><tr>  <th>Suffix</th>  <th>Meaning</th></tr><tr>  <td>s</td>  <td>seconds</td></tr><tr>  <td>m</td>  <td>minutes</td></tr><tr>  <td>h</td>  <td>hours</td></tr><tr>  <td>D</td>  <td>days</td></tr></deftable><def title="&lt;cache-mapping> schema">element cache-mapping {  (url-pattern | url-regexp)  &amp; expires?  &amp; max-age?  &amp; s-max-age?}</def><ul><li>cache-mapping requires an enabled &lt;cache&gt;.  If the cache is disabled,cache-mapping will be ignored.</li><li>cache-mapping does not automatically make a page cacheable.  Onlycacheable pages are affected by cache-mapping, i.e. pages with an ETag or Last-Modified.</li></ul><example title="Example: cache-mapping in resin-web.xml">&lt;web-app xmlns="http://caucho.com/ns/resin"&gt;  &lt;cache-mapping url-pattern='/*'                 max-age='10'/&gt;  &lt;cache-mapping url-pattern='*.gif'                 max-age='15m'/&gt;&lt;/web-app&gt;</example></defun><defun title="&lt;constraint>" version="Resin"><parents>security-constraint</parents><p>Defines a custom constraint.  Applications can define their ownsecurity constraints to handle custom authentication requirements.</p><deftable-childtags><tr>  <th>Attribute</th>  <th>Description</th></tr><tr>  <td>resin:type</td>  <td>A class that extends <a href="javadoc|com.caucho.server.security.AbstractConstraint">AbstractConstraint</a></td></tr><tr>  <td>init</td>  <td>initialization parameters, set in the object using Bean-style setters and getters</td></tr></deftable-childtags><def title="&lt;constraint> schema">element constraint {  class  &amp; init?}</def></defun><defun title="&lt;context-param>" version="Servlet 2.2"><parents>web-app</parents><p>Initializes application (ServletContext) variables.  <var>context-param</var>defines initial values for <code>application.getInitParameter("foo")</code>.  See also<a href="javadoc|javax.servlet.ServletContext">ServletContext.getInitParameter()</a>.</p><deftable title="&lt;context-param attributes"><tr>  <th>Attribute</th>  <th>Description</th></tr><tr>  <td>param-name</td>  <td>Named parameter</td></tr><tr>  <td>param-value</td>  <td>Parameter value</td></tr><tr>  <td><var/foo/></td>  <td>Parameter name</td></tr></deftable><def title="&lt;context-param> schema">element context-param {  (param-name, param-value)*  | (attribute * { string })*  | (element * { string })*}</def><example title="Example: context-param in resin-web.xml">&lt;web-app xmlns="http://caucho.com/ns/resin">  &lt;context-param&gt;    &lt;param-name&gt;baz&lt;/param-name&gt;    &lt;param-value&gt;value&lt;/param-value&gt;  &lt;/context-param&gt;  &lt;!-- shortcut --&gt;  &lt;context-param foo="bar"/&gt;&lt;/web-app&gt;</example></defun><defun title="&lt;cookie-http-only>"><parents>web-app</parents><p>The &lt;cookie-http-only> flag configures the Http-Only attributefor all Cookies generated from the web-app.  The Http-Only attributecan add security to a website by not forwarding HTTP cookies toSSL HTTPS requests.</p><def title="&lt;cookie-http-only> schema">element cookie-http-only {  r_boolean-Type}</def><example title="Example: &lt;cookie-http-only> in resin.xml">&lt;resin xmlns="http://caucho.com/ns/resin">&lt;cluster id="">  &lt;host id="www.foo.com">    &lt;web-app id="" root-directory="/var/www/foo">      &lt;cookie-http-only>true&lt;/cookie-http-only>    &lt;web-app id="">  &lt;/host>  &lt;host id="www.foo.com:443">    &lt;web-app id="" root-directory="/var/www/foo-secure">      &lt;secure/>    &lt;web-app id="">  &lt;/host>&lt;/cluster>&lt;/resin></example></defun>    <defun title="&lt;ear-deploy>"><parents>host, web-app</parents><p>Specifies ear expansion.</p><p>ear-deploy can be used in web-apps to define a subdirectoryfor ear expansion.</p><deftable title="&lt;ear-deploy> Attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>archive-path</td>  <td>The path to the directory containing ear files</td>  <td>path</td></tr><tr>  <td>ear-default</td>  <td>resin.xml default configuration for all ear files, e.g. configuringdatabase, JMS or EJB defaults.</td>  <td></td></tr><tr>  <td>expand-cleanup-fileset</td>  <td>Specifies the files which should be automatically deleted when anew .ear version is deployed.</td>  <td></td></tr><tr>  <td>expand-directory</td>  <td>directory where ears should be expanded</td>  <td>value of <var>path</var></td></tr><tr>  <td>expand-prefix</td>  <td>automatic prefix of the expanded directory</td>  <td>_ear_</td></tr><tr>  <td>expand-suffix</td>  <td>automatic suffix of the expanded directory</td>  <td></td></tr><tr>  <td>lazy-init</td>  <td>if true, the ear file is only started on first access</td>  <td>false</td></tr><tr>  <td>path</td>  <td>The path to the deploy directory</td>  <td>required</td></tr><tr>  <td>redeploy-mode</td>  <td>"automatic" or "manual".  If automatic, detects new .ear filesautomatically and deploys them.</td>  <td>automatic</td></tr><tr>  <td>url-prefix</td>  <td>optional URL prefix to group deployed .ear files</td>  <td></td></tr></deftable><def title="&lt;ear-deploy> schema">element ear-deploy {  path  &amp; archive-directory?  &amp; ear-default?  &amp; expand-cleanup-fileset?  &amp; expand-directory?  &amp; expand-path?  &amp; expand-prefix?  &amp; expand-suffix?  &amp; lazy-init?  &amp; redeploy-mode?  &amp; require-file*  &amp; url-prefix?}</def></defun><defun title="&lt;error-page>" version="Servlet 2.2"><parents>web-app</parents><deftable-childtags><tr>  <th>Attribute</th>  <th>Description</th></tr><tr>  <td>error-code</td>  <td>Select the error page based on an HTTP status code</td></tr><tr>  <td>exception-type</td>  <td>Select the error page based on a Java exception</td></tr><tr>  <td>location</td>  <td>The error page to display</td></tr></deftable-childtags><deftable title="Request attributes for error handling"><tr>  <th>Attribute</th>  <th>Type</th></tr><tr>  <td>javax.servlet.error.status_code</td>  <td>java.lang.Integer</td></tr><tr>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -