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

📄 config-webapp.xtp

📁 RESIN 3.2 最新源码
💻 XTP
📖 第 1 页 / 共 3 页
字号:
<document><header>  <product>resin</product>  <title>Web Application: Servlets and Filters</title>  <version>Resin 3.0</version>  <description>  <glossary title="web application" type="inline">  A web application is a self-contained  subtree of the web site.  It has a distinct Application object  (ServletContext), sessions, and servlet mappings.  </glossary>  <p>Web applications are configured with the <a config-tag="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 <a config-tag="host"/>.</li>  </ul>  </description></header><body><summary objsummary="localtoc"/><s1 title="Resin Web Applications"><s2 title="cache-mapping" version="Resin 1.1" type="defun"><parents>web-app-default, web-app</parents>      <p>Specifies <var>Expires</var> times for cacheable pages.</p><p>cache-mapping is intended to provide Expires times for pages thathave Last-Modified or ETags specified, but do not wish to hard-code theExpires timeout in the servlet.  For example, Resin's FileServlet relieson cache-mapping to set the expires times for static pages.</p>      <deftable-childtags><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><tr><td>expires</td><td>A time interval.</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><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="cache-mapping">&lt;web-app id='/'&gt;  &lt;cache-mapping url-pattern='/*'                 expires='10'/&gt;  &lt;cache-mapping url-pattern='*.gif'                 expires='15m'/&gt;&lt;/web-app&gt;</example></s2><s2 title="config-file" version="Resin 3.0" type="defun"><parents>web-app-default, web-app</parents><p>Specifies configuration files for the web-app.</p><p>The use of files like WEB-INF/web.xml and WEB-INF/resin-web.xmlare configured using &lt;config-file&gt;.  You can add application-specific configuration files using the &lt;config-file&gt; tag.</p><p>Configuration files will be read and applied in the order theyare specified.</p><example title="app-default.xml">...&lt;config-file&gt;WEB-INF/web.xml&lt;/config-file&gt;&lt;config-file&gt;WEB-INF/resin-web.xml&lt;/config-file&gt;...</example></s2>    <s2 title="ear-deploy" type="defun"><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-childtags><tr><td>path</td><td>The path to the deploy directory</td><td>required</td></tr><tr><td>expand-path</td><td>directory where ears should be expanded</td><td>value of path</td></tr></deftable-childtags></s2>    <s2 title="jsp" type="defun"><parents>web-app-default, web-app</parents><p>Configures JSP behavior.</p><deftable-childtags><tr><td>auto-compile</td><td>Automatically compile changed JSP files</td><td>true</td></tr><tr><td>el-ignored</td><td>Ignore EL expressions in JSP text</td><td>false</td></tr><tr><td>fast-jstl</td><td>Optimize JSTL JSP compilation</td><td>true</td></tr><tr><td>ignore-el-exception</td><td>Ignore exceptions generated in EL expressions</td><td>true</td></tr><tr><td>is-xml</td><td>Default JSP pages to use XML syntax</td><td>false</td></tr><tr><td>precompile</td><td>Try to load precompiled JSP pages</td><td>true</td></tr><tr><td>recompile-on-error</td><td>Recompile the JSP file when an Error occurs in loading</td><td>false</td></tr><tr><td>require-source</td><td>Return 404 when JSP source is deleted</td><td>false</td></tr><tr><td>dependency-check-interval</td><td>How often to check the jsp for changes, -1 disables</td><td>inherited</td></tr><tr><td>session</td><td>Creates sessions for each JSP page</td><td>true</td></tr><tr><td>velocity-enabled</td><td>Enable Velocity statements</td><td>false</td></tr></deftable-childtags><p>The class that corresponds to &lt;jsp&gt; is <a href="javadoc|com.caucho.jsp.cfg.JspPropertyGroup|"/></p></s2><s2 title="multipart-form" version="Resin 1.2" type="defun"><parents>web-app-default, web-app</parents><p>Enables multipart-mime for forms and file uploads.  multipart-mimeis disabled by default.</p><p>For an uploaded file with a form name of <var>foo</var>, the parametervalue contains the path name to a temporary file containing the uploadedfile.  <var>foo.filename</var> contains the uploaded filename, and<var>foo.content-type</var> contains the content-type of the uploaded file.</p><deftable-childtags><tr><td>upload-max</td><td>maximum size of an upload request (in kb).</td><td>no limit</td></tr></deftable-childtags><p>If the upload is larger than the limit or if multipart-form processingis disabled, Resin will not parse the request and will set an error messagein the "<var>caucho.multipart.form.error</var>" request attribute.The "<var>caucho.multipart.form.error.size</var>" will contain the attempted upload size.</p><p>Requests can set the maximum by setting the request attribute"<var>caucho.multipart.form.upload-max</var>" with an Integer or Long value.</p><p>By default, multipart-form is disabled.</p></s2><s2 title="path-mapping" type="defun"><parents>web-app-default, web-app</parents><p>Maps url patterns to real paths.  If using a server likeIIS, you may need to match the server's path aliases.</p><deftable-childtags><tr><td><var>url-pattern</var></td><td>A pattern matching the url: <var>/foo/*</var>, <var>/foo</var>, or <var>*.foo</var></td></tr><tr><td>url-regexp</td><td>A regular expression matching the url</td></tr><tr><td>real-path</td><td>The prefix of the real path.  When usedwith <var>url-regexp</var>, allows substitution variables like <var>$1</var>.</td></tr></deftable-childtags><example>&lt;web-app id='/'&gt;&lt;path-mapping url-pattern='/resin/*'              real-path='e:\resin'/&gt;&lt;path-mapping url-regexp='/~([^/]*)'              real-path='e:\home\$1'/&gt;&lt;/web-app&gt;</example></s2><s2 title="shutdown-wait-max" version="Resin 3.0.4" type="defun"><p>The maximum time Resin will wait for requests to finish before closing the web-app.</p></s2><s2 title="strict-mapping" version="Resin 1.2" type="defun"><default>false, allowing /foo/bar.jsp/foo.</default><p>Forces servlet-mapping to follow strict Servlet 2.2, disallowingPATH_INFO. Value is <var>true</var> or <var>false</var>.</p><example>&lt;web-app&gt;  &lt;strict-mapping&gt;true&lt;/strict-mapping&gt;&lt;/web-app&gt;</example></s2><s2 title="web-app-default" type="defun"><parents>server, host-default, host</parents>      <p>Establishes the defaults for a <a config-tag="web-app"/>.</p><p>When initializing a web-app, all the tags inthe web-app-defaults sections configure the web-app.  In other words,the web-app-default value is essentially a macro that is cut-and-pastedbefore the web-app configuration.</p><p>web-app-default is used for defining server-wide behavior, like *.jsphandling, and for host-wide behavior.</p><example>&lt;host&gt;  &lt;web-app-default&gt;    &lt;servlet servlet-name='test'             servlet-class='test.MyServlet'/&gt;    &lt;servlet-mapping url-pattern='*.text' servlet-class='test'/&gt;  &lt;/web-app-default&gt;&lt;/host&gt;</example></s2><s2 title="web-app" type="defun"><parents>host-default, host, WEB-INF/web.xml, WEB-INF/resin-web.xml</parents><p>web-app configures a web application.</p><deftable-childtags><tr><td>id</td><td>The url prefix selecting this application.</td><td>n/a</td></tr><tr><td>url-regexp</td><td>A regexp to select this application.</td><td>n/a</td></tr><tr><td>document-directory</td><td>The document directory forthe application, corresponding to a url of <var>/<i>id</i>/</var>. A relative path is relative to the <a config-tag="root-directory"/> of the containing <a config-tag="host"/>.  Can use regexp replacement variables.</td><td>A relative path constricted with the id or the regexp match</td></tr><tr><td>startup-mode</td><td>`automatic', `lazy', or `manual', see <a href="resin-tags.xtp#startup-mode">Startup and Redeploy Mode</a></td><td>automatic</td></tr><tr><td>redeploy-mode</td><td>`automatic' or `manual', see <a href="resin-tags.xtp#startup-mode">Startup and Redeploy Mode</a></td><td>automatic</td></tr></deftable-childtags><p>When specified by <var>id</var>, the application will be initialized onserver start.  When specified by <var>url-regexp</var>, the applicationwill be initialized at the first request.  This means that<var>load-on-startup</var> servlets may start later than expected for<var>url-regexp</var> applications.</p><p>The following example creates a web-app for /apacheusing the Apache htdocs directory to serve pages.</p><example>&lt;host id=''&gt;  &lt;web-app id='/apache' document-directory='/usr/local/apache/htdocs'&gt;  ...&lt;/host&gt;</example><p>The following example sets the root web-app to the IISroot directory. </p><example>  &lt;web-app id='/' document-directory='C:/inetpub/wwwroot'&gt;</example><p>When the <var>web-app</var> is specified with a <var>url-regexp</var>,<var>document-directory</var> can use replacement variables (<var>$2</var>).</p><p>In the following, each user gets his or her own independentapplication using <var>~user</var>.</p><example>&lt;host id=''&gt;  &lt;web-app url-regexp='/~([^/]*)'           document-directory='/home/$1/public_html'&gt;    ...  &lt;/web-app&gt;&lt;/host&gt;</example></s2><s2 title="web-app-deploy" type="defun"><parents>host, web-app</parents><p>Specifies war expansion.</p><p>web-app-deploy can be used in web-apps to define a subdirectoryfor war expansion.  The tutorials in the documentationuse web-app-deploy to allow servlet/tutorial/helloworld to be anindependent war file.</p><deftable-childtags><tr>  <td>path</td>  <td>The path to the webapps directory</td>  <td>required</td></tr><tr>  <td>url-prefix</td>  <td>url-prefix added to all expanded webapps</td>  <td>""</td></tr><tr>  <td>expand-path</td>  <td>directory where wars should be expanded</td>  <td>value of path</td></tr><tr>  <td>lazy-init</td>  <td>true if web-apps should only be initialized when first used</td>  <td>false</td></tr><tr>  <td>versioning</td>  <td>if true, versioned applications are served according to the base-name, e.g. webapps/foo-1.1 is served as /foo.</td>  <td>false</td></tr><tr>  <td>web-app-default</td>  <td>defaults to be applied to expaned web-apps</td>  <td></td></tr><tr>  <td>web-app</td>  <td>overriding configuration for specific web-apps</td>  <td></td></tr></deftable-childtags><p>The web-app-deploy can override configuration for an expanded war witha matching &lt;web-app&gt; inside the &lt;web-app-deploy&gt;.  The

⌨️ 快捷键说明

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