📄 webapp-tags.xtp
字号:
element servlet-regexp { init? & servlet-class? & servlet-name? & url-regexp}</def><example><servlet-regexp url-regexp="/([^.]*).do" servlet-class="qa.\${regexp[1]}Servlet"> <init a="b"/></servlet-regexp></example></defun><defun title="<session-config>" version="Servlet 2.2"><p><session-config> configures Resin's session handling, including thecookies Resin sends, the maximum sessions, and session persistence and clustering.</p><p>See also: <a href="resin-clustering.xtp">Resin clustering</a> for moreinformation about distributed sessions and persistence.</p><deftable title="<session-config> Attributes"><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr> <td>always-load-session</td> <td>Reload data from the store on every request</td> <td>false</td></tr><tr> <td>always-save-session</td> <td>Save session data to the store on every request</td> <td>false</td></tr><tr> <td>enable-cookies</td> <td>Enable cookies for sessions</td> <td>true</td></tr><tr> <td>enable-url-rewriting</td> <td>Enable URL rewriting for sessions</td> <td>true</td></tr><tr> <td>cookie-version</td> <td>Version of the cookie spec for sessions</td> <td>1.0</td></tr><tr> <td>cookie-domain</td> <td>Domain for session cookies</td> <td>none</td></tr><tr> <td>cookie-max-age</td> <td>Max age for persistent session cookies</td> <td>none</td></tr><tr> <td>cookie-length</td> <td>Maximum length of the cookie</td> <td></td></tr><tr> <td>ignore-serialization-errors</td> <td>When persisting a session, ignore any values which don't implement java.io.Serializable</td> <td>false</td></tr><tr> <td>invalidate-after-listener</td> <td>If true, invalidate the sessions after the session listeners havebeen called</td> <td></td></tr><tr> <td>reuse-session-id</td> <td>Reuse the session id even if the session has timed out. A value of false defeats single signon capabilities. (resin 2.0.4)</td> <td>true</td></tr><tr> <td>session-max</td> <td>Maximum active sessions</td> <td>4096</td></tr><tr> <td>session-timeout</td> <td>The session timeout in minutes, 0 means never timeout.</td> <td>30 minutes</td></tr><tr> <td>serialization-type</td> <td>Use one of "java" or "hessian" for serialization, hessian is significantly faster and smaller (resin 3.1.2)</td> <td>java</td></tr><tr> <td>save-mode</td> <td>When to save sessions, one of "before-headers", "after-request", or "on-shutdown"</td> <td>after-request</td></tr><tr> <td>use-persistent-store</td> <td>Uses the current <a href="resin.xtp#persistent-store">persistent-store</a> to save sessions. (resin 3.0.8)</td> <td>none</td></tr></deftable><def title="<session-config> schema">element session-config { always-load-session? & always-save-session? & cookie-append-server-index? & cookie-domain? & cookie-length? & cookie-max-age? & cookie-port? & cookie-secure? & cookie-version? & enable-cookies? & enable-url-rewriting? & ignore-serialization-errors? & invalidate-after-listener? & reuse-session-id? & save-mode? & save-on-shutdown? & serialization-type? & session-max? & session-timeout? & use-persistent-store?}</def><p>The <var>session-timeout</var> and <var>session-max</var> are usuallyused together to control the number ofsessions. Sessions are stored in an LRU cache. When the numberof sessions in the cache fills up past <var>session-max</var>, theoldest sessions are recovered. In addition, sessions idle forlonger than <code>session-timeout</code> are purged.</p><example title="using session-config and session-timeout to control the number of sessions"><web-app id='/dir'> <session-config> <!-- 2 hour timeout --> <session-timeout>120</session-timeout> <session-max>4096</session-max> </session-config></web-app></example><p><var>cookie-length</var> is used to limit the maximum length forthe session's generated cookie for special situations like WAP devices.Reducing this value reduces the randomness in the cookie and increases thechance of session collisions.</p><p><var>reuse-session-id</var> defaults to true so that Resin can share the sessionid amongst different web-apps.</p><p>The class that corresponds to <session-config> is <a href="javadoc|com.caucho.server.session.SessionManager|"/></p></defun><defun 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><default>15s</default><def title="<shutdown-wait-max> schema">element shutdown-wait-max { r_period-Type}</def></defun><defun title="<statistics-enable>"><default>false</default><p><statistics-enable> enables more detailed statistics for the<code>WebAppMXBean</code> administration. The statistics gatheringis disabled by default for performance reasons.</p><def title="<statistics-enable> schema">element statistics-enable { r_boolean-Type}</def></defun><defun 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><def title="<strict-mapping> schema">element strict-mapping { r_boolean-Type}</def><example title="Example: enabling strict-mapping in resin-web.xml"><web-app xmlns="http://caucho.com/ns/resin"> <strict-mapping>true</strict-mapping></web-app></example></defun><defun title="<user-data-constraint>" version="Servlet" type="defun"><parents>security-constraint</parents><p>Restricts access to secure transports, such as SSL</p><deftable title="<user-data-constraints> Attributes"><tr> <th>Attribute</th> <th>Description</th></tr><tr> <td>transport-guarantee</td> <td>Required transport properties. NONE,INTEGRAL, and CONFIDENTIAL are allowed values.</td></tr></deftable><def title="<user-data-constraint> schema">element user-data-constraint { transport-guarantee}</def></defun><defun title="<web-app>" type="defun"><parents>host, web-app</parents><p>web-app configures a web application.</p><deftable-childtags><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr> <td>active-wait-time</td> <td>how long a thread should wait for the web-app to initialize before returning a 503-busy.</td> <td>15s</td></tr><tr> <td>archive-path</td> <td>Specifies the location of the web-app's .war file.</td> <td>n/a</td></tr><tr> <td>context-path</td> <td>Specifies the URL prefix for the web-app.</td> <td>the <var>id</var> value</td></tr><tr> <td>id</td> <td>The url prefix selecting this application.</td> <td>n/a</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><tr> <td>redeploy-check-interval</td> <td>how often to check the .war archive for redeployment</td> <td>60s</td></tr><tr> <td>root-directory</td> <td>The root directory for the 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>startup-priority</td> <td>specifies a priority for web-app startup to force an ordering between webapps </td> <td>-1</td></tr><tr> <td>url-regexp</td> <td>A regexp to select this application.</td> <td>n/a</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><host id=''> <web-app id='/apache' document-directory='/usr/local/apache/htdocs'> ...</host></example><p>The following example sets the root web-app to the IISroot directory. </p><example> <web-app id='/' document-directory='C:/inetpub/wwwroot'></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><host id=''> <web-app url-regexp='/~([^/]*)' document-directory='/home/$1/public_html'> ... </web-app></host></example></defun><defun title="<web-app-default>" type="defun"><parents>cluster, host, web-app</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><host> <web-app-default> <servlet servlet-name='test' servlet-class='test.MyServlet'/> <servlet-mapping url-pattern='*.text' servlet-class='test'/> </web-app-default></host></example></defun><defun 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 title="<web-app-deploy> Attributes"><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr> <td>archive-directory</td> <td>directory containing the .war files</td> <td>value of <var>path</var></td></tr><tr> <td>dependency-check-interval</td> <td>How often to check the .war files for a redeploy</td> <td>60s</td></tr><tr> <td>expand-cleanup-fileset</td> <td>defines the files which should be automatically deletedwhen an updated .war expands</td> <td>all files</td></tr><tr> <td>expand-directory</td> <td>directory where wars should be expanded</td> <td>value of <var>path</var></td></tr><tr> <td>expand-prefix</td> <td>prefix string to use when creating the expansion directory, e.g. _war_</td> <td></td></tr><tr> <td>expand-suffix</td> <td>prefix string to use when creating the expansion directory, e.g. .war</td> <td></td></tr><tr> <td>path</td> <td>The path to the webapps directory</td> <td>required</td></tr><tr> <td>redeploy-mode</td> <td>"automatic" or "manual"</td> <td>automatic</td></tr><tr> <td>require-file</td> <td>additional files to use for dependency checking for auto restart</td> <td></td></tr><tr> <td>startup-mode</td> <td>"automatic", "lazy" or "manual"</td> <td>automatic</td></tr><tr> <td>url-prefix</td> <td>url-prefix added to all expanded webapps</td> <td>""</td></tr><tr> <td>versioning</td> <td>if true, use the web-app's numeric suffix as a version</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><def title="<web-app-deploy> schema">element web-app-deploy { archive-directory? expand-cleanup-fileset? expand-directory? expand-prefix? expand-suffix? path? redeploy-check-interval? redeploy-mode? require-file* startup-mode? url-prefix? versioning? web-app-default* web-app*}</def><s2 title="Overriding web-app-deploy configuration"><p>The web-app-deploy can override configuration for an expanded war witha matching <web-app> inside the <web-app-deploy>. The<document-directory> is used to match web-apps.</p><example title="Example: resin.xml overriding web.xml"><resin xmlns="http://caucho.com/ns/resin"><cluster id=""><host id=""><web-app-deploy path="webapps"> <web-app context-path="/wiki" document-directory="wiki"&g
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -