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

📄 app-config.xtp

📁 解压在c盘
💻 XTP
📖 第 1 页 / 共 3 页
字号:
Double dValue = (Double) env.lookup("max-price");double price = dValue.doubleValue();%></example></defun><defun name=error-log title='error-log' index='error-log'><p>Specifies the file for error logging.  Seethe host <a href="http-config.xtp#error-log">error-log</a> for more details.</p><p>The default uses the containing host's error log.</p></defun><defun title='error-page' index='error-page' version="Servlet 2.2"><p>A page to display if the current request fails. The webserver plugins use a <a href='http-config.xtp#error-page'>special case</a>of error-page to handle connection failures.</p><deftable><tr><th>Attribute<th>Description<tr><td>location<td>The error page to display<tr><td>exception-type<td>Select the error page based on a Java exception<tr><td>error-code<td>Select the error page based on an HTTP status code</deftable><example title='Catching File Not Found'>&lt;web-app id='/'&gt;    &lt;error-page error-code='404'                location='/file_not_found.jsp'/>&lt;/web-app&gt;</example><example title='Catching Exceptions'>&lt;web-app id='/foo'&gt;      &lt;error-page exception-type='java.lang.NullPointerException'                  location='/nullpointer.jsp'/>&lt;/web-app></example><p>The following is a special case for the mod_caucho or isapi_srunplugin to redirect to another page if it can't connect to srun.Unlike the other two forms, this must be in http-server web-app asbelow.  It can't be in a specific web-app.</p><example title="Special can't connect to srun">&lt;caucho.com>&lt;http-server>&lt;error-page exception-type='connection'              location='/missing_file.html'/>	      &lt;/http-server&gt;&lt;/caucho.com&gt;</example><p>By default, Resin returns a 500 Servlet Error and a stack trace forexceptions and a simple 404 File Not Found for error pages.</p></defun><defun title="invalidate-after-listener" version="Resin 2.1.4"><p>If true, listeners are called before the session is invalidated.According to the Servlet spec, the session is invalidated beforelisteners are called.  This means the listeners can't callgetAttribute methods.  For many applications, the spec behavioris not useful.</p><p>Default: false</p></defun><defun title='jdbc-store' version="Servlet 2.2"><p>Configure sessions to use a JDBC backing store. The database must bespecified using the resource-ref configuration.  The database storewill automatically create a table to store the sessions.</p><deftable><tr><td>data-source<td>data source name for the table<tr><td>table-name<td>database table for the session data<tr><td>blob-type<td>database type for a blob<tr><td>timestamp-type<td>database type for a blob<tr><td>session-timeout<td>cleanup time</deftable><example title="Example configuration">&lt;session-config>  &lt;jdbc-store>    &lt;data-source>jdbc/sessions&lt;/data-source>  &lt;/jdbc-store>&lt;/session-config></example><example title="Example table created by session">CREATE TABLE session (  id VARCHAR(64) NOT NULL,  data BLOB,  mod_time TIMESTAMP,  PRIMARY KEY(id))</example><p>By default, Resin does not use JDBC persistent sessions.</p></defun><defun title="jndi-link" version="Resin 1.2"><p>Links a foreign JNDI context to the Resin JNDI context.For example, you can use <var/jndi-link/> to link in client EJBs froma foreign EJB container.</p><deftable><tr><th>Attribute<th>Description.<tr><td>jndi-name<td>JNDI path attribute to bind the link<tr><td>property-file<td>jndi.property to use to obtain the Context.<tr><td>jndi-factory<td>Class name of an InitialContextFactory used tocreate the bean.<tr><td>init-param<td>Properties to be used to get the initialcontext.<tr><td>jndi-lookup<td>JNDI path for the foreign context.</deftable><example title="Linking a WebLogic EJB client bean">&lt;jndi-link>  &lt;jndi-name>java:comp/env/ejb/traderHome&lt;/jndi-name>  &lt;jndi-factory>weblogic.jndi.WLInitialContextFactory&lt;/jndi-factory>  &lt;init-param java.naming.provider.url="t3://localhost:7001"/>  &lt;jndi-lookup>statelessSession.TraderHome&lt;/jndi-lookup>&lt;/jndi-link></example><p>By default, Resin does not add any special JNDI links.</p></defun><defun name=jsp title='jsp' version="Resin 1.1"><p>JSP configuration.</p><deftable><tr><th>attribute<th>meaning<th>default<tr><td>auto-compile<td>if false, changes in .jsp will not<tr><td>disable-init-log<td>if true, disables logging of the jsp init and destroy<td>false<tr><td>jsp-update-interval<td>How often JSP files should be checked for changes (since Resin 2.1.1)<td>class-update-interval<tr><td>jsp-max<td>limit the number of active JSP pages<td>1024<tr><td>precompile<td>use precompiled JSP classes if available.<td>true<tr><td>require-source<td>check to see if the *.jsp file has been deleted<td>false<tr><td>recompile-on-error<td>If the JSP page throws a java.lang.Error, recompile it. (since Resin 1.2.3)<td>false<tr><td>recycle-tags<td>recycles tags following the JSP 1.2 (since Resin 2.0.2)<td>true<tr><td>session<td>If "false", disable sessions by default.<td>true<tr><td>static-encoding<td>allow JSP to precompile character encoding.<td>trueforce auto-compile.<td>true<tr><td>velocity<td>allows Velocity-style syntax (since Resin 2.0.3)<td>false</deftable></defun><defun title='lazy-init' version="Resin 2.1.1"><p>Marks the web-app as lazily initialized.  Normally,web-apps are loaded when Resin starts and the load-on-init servlets are run.With lazy-init, the web-app will only be started on the first request.</p></defun><defun title=login-config version="Servlet 2.2"><p>Configures user authentication.  See<a href='security.xtp'>auth config</a> for more details.</p><deftable><tr><th>Attribute<th>Meaning<tr><td>auth-method<td>Authentication method<tr><td>form-login-config<td>Configuration for form login<tr><td>authenticator<td>Select authenticator class<tr><td>security-constraint<td>Select the files to protect.</deftable><p>By default, Resin does not authenticate.</p></defun><defun title='mime-mapping' index='mime-mapping' version="Servlet 2.2"><p>Maps url patterns to mime-types.</p><deftable><tr><th>Attribute<th>Meaning<tr><td>extension<td>url extension<tr><td>mime-type<td>the mime-type</deftable><example>&lt;web-app id='/'&gt;&lt;mime-mapping extension='.foo'              mime-type='text/html'/&gt;&lt;/web-app></example><p>Resin has a long list of default mime types in com.caucho.server.http.Application.</p></defun><defun title="multipart-form" version="Resin 1.2"><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/>, the parametervalue contains the path name to a temporary file containing the uploadedfile.  <var/foo.filename/> contains the uploaded filename, and<var/foo.content-type/> contains the content-type of the uploaded file.</p><deftable><tr><th>Attribute<th>Meaning<th>Default<tr><td>enable<td>if set false, this disables multipart-form processing.<td>true<tr><td>upload-max<td>maximum size of an upload request (default in kb).<td>no limit</deftable><deftable><tr><th>units<th>bytes<tr><td>128<td>128 bytes<tr><td>128b<td>128 bytes<tr><td>128k<td>128 kilobytes<tr><td>128m<td>128 megabytes<tr><td>128g<td>128 gigabytes</deftable><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 "caucho.multipart.form.error" request attribute. (Resin 2.0.2)</p><p>By default, multipart-form is disabled.</p></defun><defun title="run-at" version="Resin 1.1"><p>Times to execute the servlet automatically.The run-at value in the servlet configuration configures a servlet to berun at certain times of the day.</p><p>The value of the run-at is a list of hours or minutes the servletshould be run at.  To run the servlet at 3am and at 2:25pm, use:</p><example title='Run test.Alarm at 3am and 2:25pm'>&lt;servlet servlet-name='foo' servlet-class='test.Alarm'>  &lt;run-at>3:00 14:25&lt;/run-at>&lt;/servlet></example><p>To run the servlet at 5 minutes past the hour and at 45 minutes past theour use ":05 :45".</p><p>You can also assign a period to the run-at, instead of specifyingspecific times.  This can be useful if the period is something short likeevery 5 minutes:</p><example title='Run test.Alarm every 5 minutes'>&lt;servlet servlet-name='foo' servlet-class='test.Alarm'>  &lt;run-at period='5m'/>&lt;/servlet></example></defun><defun title="servlet-mapping" version="Servlet 2.2"><p>Maps url patterns to servlets.  <var/servlet-mapping/> has twochildren, <var/url-pattern/> and <var/servlet-name/>.<var/url-pattern/>selects the urls which should execute the servlet.</p><p><code/servlet-name/> can either specify a servlet class directly or itcan specify a servlet alias defined by <code/servlet/>.</p><p>The special <code/servlet-name/> <em/invoker/> is used to dispatchservlets by class name.  For example, /servlets/test.HelloServlet.</p><deftable><tr><th>attribute<th>meaning<th>default<tr><td><var/url-pattern/><td>A pattern matching the url:<var//foo/*/>, <var//foo/>, or <var/*.foo/><td>n/a<tr><td>url-regexp<td>A regular expression matching the url<td>n/a<tr><td>servlet-name<td>The servlet name (can use replacement varslike <var/$1/>)<td>n/a<tr><td>path-info<td>Path info rewriting string (can use replacementvars like <var/$1/>)<td>The standard path-info<tr><td>servlet-class<td>The servlet's class<td>uses servlet-name<tr><td>init-param<td>Initialization parameters<td>n/a<tr><td>load-on-startup<td>Initializes the servlet when the server starts.<td>none<tr><td>run-at<td>Times to execute the servlet automatically<td>none<tr><td>case-sensitive<td>If true, the match is case-sensitive<td>true on Unix and false on Windows</deftable><example>&lt;caucho.com&gt;&lt;web-app id='/'&gt;&lt;servlet servlet-name='hello'         servlet-class='test.HelloWorld'/&gt;&lt;servlet-mapping url-pattern='/hello.html'                 servlet-name='hello'/&gt;&lt;servlet-mapping url-pattern='/servlet/*'                 servlet-name='invoker'/&gt;&lt;servlet-mapping url-pattern='*.xtp'                 servlet-name='com.caucho.jsp.XtpServlet'/&gt;&lt;/web-app></example><p>The plugins use servlet-mapping to decide which URLs to send to Resin.The following servlet-name value are special:</p><deftable><tr><td>plugin_match<td>The plugin will send the request to Resin, butResin will ignore the entry.  Use to get around regexp limitations. (Resin 1.2.2)<tr><td>plugin_ignore<td>The plugin will ignore the request.  Use thisto define a sub-url the web server should handle, not Resin. (Resin 1.2.2)</deftable></defun><defun title='servlet' version="Servlet 2.2"><p>Defines a servlet alias for later mapping.  More details are in the<a href='servlet-config.xtp'>servlet configuration</a> section.</p><deftable><tr><th>Attribute<th>Meaning<tr><td>servlet-name<td>The servlet's name (alias)<tr><td>servlet-class<td>The servlet's class (defaults to servlet-name)<tr><td>init-param<td>Initialization parameters<tr><td>load-on-startup<td>Initializes the servlet when the server starts.<tr><td>run-at<td>Times to execute the servlet automatically (Resin 1.1)<tr><td>init<td>Allows bean-style configuration.  See the <a href="servlet.xtp#init">servlet</a> page (Resin 2.1.3).</deftable><p>The following example defines a servlet alias 'hello'</p><example>&lt;web-app id='/'&gt;&lt;servlet-mapping url-pattern='/hello.html'                 servlet-name='hello'/&gt;&lt;servlet servlet-name='hello'         servlet-class='test.HelloWorld'&gt;  &lt;init-param title='Hello, World'/&gt;&lt;/servlet&gt;&lt;servlet servlet-name='cron'         servlet-class='test.DailyChores'&gt;  &lt;run-at&gt;3:00&lt;/run-at&gt;&lt;/servlet&gt;&lt;/web-app&gt;</example></defun><defun title='session-config' version="Servlet 2.2"><p>Contains session configuration parameters.</p><deftable><tr><th>Attribute<th>Meaning<th>Default<tr><td>session-timeout<td>The session timeout in minutes<td>30 minutes<tr><td>session-max<td>Maximum active sessions<td>4096<tr><td>enable-cookies<td>Enable cookies for sessions (resin 1.1)<td>true<tr><td>enable-url-rewriting<td>Enable URL rewriting for sessions (resin 1.1)<td>true<tr><td>cookie-version<td>Version of the cookie spec for sessions (resin 1.2)<td>1.0

⌨️ 快捷键说明

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