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

📄 webapp-tags.xtp

📁 RESIN 3.2 最新源码
💻 XTP
📖 第 1 页 / 共 5 页
字号:
  <td>javax.servlet.error.message</td>  <td>java.lang.String</td></tr><tr>  <td>javax.servlet.error.request_uri</td>  <td>java.lang.String</td></tr><tr>  <td>javax.servlet.error.servlet_name</td>  <td>java.lang.String</td></tr><tr>  <td>javax.servlet.error.exception</td>  <td>java.lang.Throwable</td></tr><tr>  <td>javax.servlet.error.exception_type</td>  <td>java.lang.Class</td></tr></deftable><def title="&lt;error-page> schema">element error-page {  (error-code | exception-type)?  &amp; location}</def><p>By default, Resin returns a 500 Servlet Error and a stack trace forexceptions and a simple 404 File Not Found for error pages.  Applications cancustomize the response generated for errors.  </p><example title="Example: Catching File Not Found">&lt;web-app xmlns="http://caucho.com/ns/resin"&gt;  &lt;error-page&gt;    &lt;error-code&gt;404&lt;/error-code&gt;    &lt;location&gt;/file_not_found.jsp&lt;/location&gt;  &lt;/error-page&gt;&lt;/web-app&gt;</example><example title="Example: Catching Exceptions">&lt;web-app xmlns="http://caucho.com/ns/resin">   &lt;error-page exception-type="java.lang.NullPointerException"               location="/nullpointer.jsp"/&gt;&lt;/web-app&gt;</example><p>The error page can use request attributes to obtain information about therequest that caused the error:</p><example title="Example: /file_not_found.jsp">&lt;%@ page session="false" isErrorPage="true" %&gt;&lt;html&gt;&lt;head&gt;&lt;title&gt;404 Not Found&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;h1&gt;404 Not Found&lt;/h1&gt;The url &lt;code&gt;${requestScope["javax.servlet.error.request_uri"]}&lt;/code&gt; was not found.&lt;/body&gt;&lt;/html&gt;</example></defun><defun title="&lt;filter>" version="Servlet 2.3"><p>Defines a filter name for later mapping.  Because Filters are fullyintegrated with <a href="resin-ioc.xtp">Resin-IoC</a>, they canuse dependency-injection, transactional aspects, custom interceptionwith @InterceptorType, and event handling with @Observes.</p><deftable-childtags><tr>  <th>Attribute</th>  <th>Description</th></tr><tr>  <td>filter-name</td>  <td>The filter's name (alias)</td></tr><tr>  <td>filter-class</td>  <td>The filter's class (defaults to filter-name), which extends <a href="javadoc|javax.servlet.Filter">javax.servlet.Filter</a></td></tr><tr>  <td>init</td>  <td>Resin-IoC initialization configuration, see <a href="resin-ioc.xtp">Resin-IoC</a></td></tr><tr>  <td>init-param</td>  <td>Initialization parameters, see <a href="javadoc|javax.servlet.FilterConfig">FilterConfig.getInitParameter</a></td></tr></deftable-childtags><def title="&lt;filter> schema">element filter {  filter-name  &amp; filter-class  &amp; init*  &amp; init-param*}</def><p>The following example defines a filter alias 'image'</p><example title="Example: WEB-INF/resin-web.xml">&lt;web-app xmlns="http://caucho.com/ns/resin">  &lt;filter&gt;    &lt;filter-name&gt;image&lt;/filter-name&gt;    &lt;filter-class&gt;test.MyImage&lt;/filter-class&gt;    &lt;init-param&gt;      &lt;param-name&gt;title&lt;/param-name&gt;      &lt;param-value&gt;Hello, World&lt;/param-value&gt;    &lt;/init-param&gt;  &lt;/filter&gt;  &lt;filter-mapping&gt;    &lt;filter-name&gt;image&lt;/filter-name&gt;    &lt;url-pattern&gt;/images/*&lt;/url-pattern&gt;  &lt;/filter-mapping&gt;&lt;/web-app&gt;</example><p>The full Servlet 2.3 syntax for <var>init-param</var> is supported aswell as a simple shortcut.</p><example title="WEB-INF/resin-web.xml">&lt;web-app id='/'&gt;&lt;filter filter-name='test.HelloWorld'&gt;  &lt;init-param foo='bar'/&gt;  &lt;init-param&gt;    &lt;param-name&gt;baz&lt;/param-name&gt;    &lt;param-value&gt;value&lt;/param-value&gt;  &lt;/init-param&gt;&lt;/servlet&gt;&lt;/web-app&gt;</example></defun><defun title="&lt;filter-mapping>" version="Servlet 2.3" type="defun"><p>Maps url patterns to filters.  <var>filter-mapping</var> has twochildren, <var>url-pattern</var> and <var>filter-name</var>.<var>url-pattern</var> selects the urls which should execute the filter.</p><p><code>filter-name</code> can either specify a servlet class directly or itcan specify a servlet alias defined by <code>filter</code>.</p><deftable title="&lt;filter-mapping> attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>dispatcher</td>  <td>REQUEST, INCLUDE, FORWARD, ERROR</td>  <td>REQUEST</td></tr><tr>  <td>filter-name</td>  <td>The filter name</td>  <td>required</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 portion of the url that follows the <g>context path</g></td>  <td></td></tr></deftable><def title="&lt;filter-mapping> schema">element filter-mapping {  (url-pattern | url-regexp | servlet-name)+  &amp; filter-name  &amp; dispatcher*}</def><example title="Example: resin-web.xml filters">&lt;web-app xmlns="http://caucho.com/ns/resin"&gt;  &lt;filter&gt;    &lt;filter-name&gt;test-filter&lt;/filter-name&gt;    &lt;filter-class&gt;test.MyFilter&lt;/filter-class&gt;  &lt;/filter&gt;  &lt;filter-mapping&gt;    &lt;filter-name&gt;test-filter&lt;/filter-name&gt;    &lt;url-pattern&gt;/hello/*&lt;/url-pattern&gt;  &lt;/filter-mapping&gt;  &lt;servlet&gt;    &lt;servlet-name&gt;hello&lt;/servlet-name&gt;    &lt;servlet-class&gt;test.HelloWorld&lt;/servlet-class&gt;  &lt;/servlet&gt;  &lt;servlet-mapping&gt;    &lt;servlet-name&gt;hello&lt;/servlet-name&gt;    &lt;url-pattern&gt;/hello&lt;/url-pattern&gt;  &lt;/servlet-mapping&gt;&lt;/web-app&gt;</example><p><code>url-regexp</code> matches the portion of the url that follows the <g>context path</g>.  A webapp in <code>webapps/ROOT</code>, and a url<code>http://localhost/foo/hello.html</code> will have a value of <code>"/foo/hello.html"</code> for thepurposes of the regular expression match.A webapp in <code>webapps/baz</code> and a url<code>http://localhost/baz/hello.html</code> will have a url of <code>"/hello.html"</code> for thepurposes of the regular expression match, because "/baz" is the context path.</p></defun><defun title="&lt;form-login-config>" version="Servlet" type="defun"><parents>login-config</parents><p>Configures authentication using forms.  The login form hasspecific parameters that the servlet engine's login form processingunderstands.  If the login succeeds, the user will see the originalpage.  If it fails, she will see the error page.</p><deftable title="&lt;form-login-config> attributes"><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>form-login-page</td>  <td>The page to be used to prompt the user login</td>  <td></td></tr><tr>  <td>form-error-page</td>  <td>The error page for unsuccessful login</td>  <td></td></tr><tr>  <td>internal-forward</td>  <td>Use an internal redirect on success instead of a sendRedirect</td>  <td>false</td></tr><tr>  <td>form-uri-priority</td>  <td>If true, the form's j_uri will override a stored URI</td>  <td>false</td></tr></deftable><p>The form itself must have the action <var>j_security_check</var>.  Itmust also have the parameters <var>j_username</var> and <var>j_password</var>.Optionally, it can also have <var>j_uri</var> and<var>j_use_cookie_auth</var>.  <var>j_uri</var> gives the next page to displaywhen login succeeds.  <var>j_use_cookie_auth</var> allows Resin to send apersistent cookie to the user to make following login easier.</p><p><var>j_use_cookie_auth</var> gives control to the user whether to generatea persistent cookie.  It lets you implement the "remember me" button.  Bydefault, the authentication only lasts for a single session.</p><deftable-childtags><tr>  <th>Attribute</th>  <th>Description</th></tr><tr>  <td>j_security_check</td>  <td>The form's mandatory action</td></tr><tr>  <td>j_username</td>  <td>The user name</td></tr><tr>  <td>j_password</td>  <td>The password</td></tr><tr>  <td>j_uri</td>  <td>Optional Resin extension for the successful display page.</td></tr><tr>  <td>j_use_cookie_auth</td>  <td>Optional Resin extension to allow cookie login.</td></tr></deftable-childtags><def title="&lt;form-login-config> schema">element form-login-config {  form-login-page,  form-error-page,  internal-forward,  form-uri-priority}</def><p>The following is an example of a servlet-standard login page:</p><example title="Example: login.html">&lt;form action='j_security_check' method='POST'&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;User:&lt;td&gt;&lt;input name='j_username'&gt;&lt;tr&gt;&lt;td&gt;Password:&lt;td&gt;&lt;input name='j_password'&gt;&lt;tr&gt;&lt;td colspan=2&gt;hint: the password is 'quidditch'&lt;tr&gt;&lt;td&gt;&lt;input type=submit&gt;&lt;/table&gt;&lt;/form&gt;</example></defun>    <defun title="&lt;idle-time>"><parents>web-app</parents><p>The &lt;idle-time> specifies the timeout for lazy-idle web-apps.In some configurations, web-apps are created only on demand and areclosed when no requests access the web-app.  The idle-time configureswhen those web-apps should be freed.</p><p>For example, the resin-doc web-app uses idle-time for itschild web-apps because there are a large number of sub-web-apps forthe individual tutorials.</p><def title="&lt;idle-time> schema">element idle-time {  r_period-Type}</def></defun><defun title="&lt;jsf>" type="defun"><parents>web-app</parents><p>Configures JSF behavior.</p><deftable-childtags><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>fast-jsf</td>  <td>Optimize JSF code generation</td>  <td>true</td></tr><tr>  <td>state-serialization-method</td>  <td>Configures method of JSF state serialization. Setting value to    <code>hessian</code> provides fast, size optimized Hessian    serialization. Method <code>java</code> allows fallback    to Java Serialization.  </td>  <td>hessian</td></tr><tr>  <td>enable-developer-aid</td>  <td>if true, makes snapshots of component tree and request information    available via a link displayed at the right bottom corner of a JSF page.  </td>  <td>false</td></tr><tr>  <td>developer-aid-link-style</td>  <td>controls appearance of the <em>JSF Dev Aid</em> on a JSF page.  </td>  <td>position:absolute; bottom:0; right:0</td></tr></deftable-childtags><def title="&lt;jsf> schema">element jsf {  &amp; fast-jsf?}</def></defun><defun title="&lt;jsp>" type="defun"><parents>web-app</parents><p>Configures JSP behavior.</p><deftable-childtags><tr>  <th>Attribute</th>  <th>Description</th>  <th>Default</th></tr><tr>  <td>auto-compile</td>  <td>Automatically compile changed JSP files</td>  <td>true</td></tr><tr>  <td>deferred-syntax-allowed-as-literal</td>  <td>enables the #{...} syntax as text contents</td>  <td>true</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>el-ignored</td>  <td>Ignore EL expressions in JSP text</td>  <td>false</td></tr><tr>  <td>fast-jstl</td>  <td>Optimize JSTL code generation</td>  <td>true</td></tr><tr>  <td>ignore-el-exception</td>  <td>Ignore exceptions generated in EL expressions.  For debugging,set to false</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>page-encoding</td>  <td>Sets the default page encoding</td>  <td>ISO-8859-1</td></tr><tr>  <td>precompile</td>  <td>Try to load precompiled JSP pages</td>  <td>true</td></tr><tr>  <td>print-null-as-blank</td>  <td>If true, expressions evaluating to null are not printed</td>  <td>false</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>recycle-tags</td>  <td>Reuse tag instances when possible for performance</td>  <td>true</td></tr><tr>  <td>require-source</td>  <td>Return 404 when JSP source is deleted</td>  <td>false</td></tr><tr>  <td>scriping-invalid</td>  <td>Disables all Java scripting and expression in JSP pages</td>  <td>false</td></tr><tr>  <td>session</td>  <td>Creates sessions for each JSP page</td>  <td>true</td></tr><tr>  <td>static-page-generates-class</td>  <td>If true, JSPs with no active content still generate a .class</td>  <td>true</td></tr><tr>  <td>tld-dir</td>  <td>restricts the directory to scan for .tld files, improving startup performance</td>  <td>WEB-INF</td></tr><tr>  <td>tld-file-set</td>  <td>adds an ant-style pattern for .tld scanning</td>  <td>WEB-INF</td></tr><tr>  <td>trim-directive-whitespace</td>  <td>if true, trims whitespace around JSP directives</td>  <td>false</td></tr>

⌨️ 快捷键说明

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