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

📄 app-config.xtp

📁 解压在c盘
💻 XTP
📖 第 1 页 / 共 3 页
字号:
<s1 title="Web Application Configuration"><p>HTTP configuration follows the Servlet 2.2 deployment descriptors.The nesting order is important, but order is generally not important.In the sections that follow, the sectionheader tells where the attribute belongs.  For example, an attribute in<var/caucho.com/http-server/host/> belongs in a <var/host/> element whichbelongs in an <var/http-server/> element which belongs in the<var/caucho.com/> element.</p><p>The application configuration can be placed in <var/WEB-INF/web.xml/>If <var/web.xml/> exists, Resin will use it to configure the application.</p><p><a href='servlet-config.xtp'>Servlet</a> configuration interacts with theapplication configuration.  In particular, <var/servlet-mapping/> tells Resinhow to map urls to servlets.</p><objsummary/><s2 title='web-app'><defun title='access-log'><p>Specifies the access logging.  Seethe host <a href="http-config.xtp#access-log">access-log</a> for more details.</p><p>By default, uses the host access-log.</p></defun><defun title="allow-admin" version="Resin 2.1"><p>Allows administration from the web-app.  allow-admin must bespecified in the resin.conf for security.  In other words, a.war file can't enable admin in its web.xml.</p><p><b>Default:</b> false</p></defun><defun title="allow-servlet-el" version="Resin 2.1.3"><p>Allows JSP EL expressions in &lt;init-param> for servlets, filters,and the &lt;context-param>.</p><example>&lt;servlet>  &lt;servlet-name>hello&lt;/servlet-name>  &lt;init-param greeting="Hello, ${host.url}"/>&lt;/servlet></example></defun><defun title='app-dir' version="Resin 1.1"><p>Specifies the directory of the application. Ifunspecified, the application will have the same path as the id.  Whenthe <var/web-app/> is specified with a <var/url-regexp/>,<var/app-dir/> can use replacement variables (<var/$2/>).</p><p>When specified by <var/id/>, the application will be initializedon server start.  When specified by <var/url-regexp/>, the application willbe initialized at the first request.  This means that <var/load-on-startup/>servlets may start later than expected for <var/url-regexp/> applications.</p><deftable><tr><th>Attribute<th>Meaning<th>Default<tr><td>id<td>The url prefix selecting this application.<td>n/a<tr><td>url-regexp<td>A regexp to select this application.<td>n/a<tr><td>app-dir<td>The root document directory for the application (can useregexp replacement variables.)<td>Same as id or the regexp match</deftable><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' app-dir='/usr/local/apache/htdocs'&gt; ...&lt;/host&gt;</example><p>The following example sets the root application to the IISroot directory.  The host and web-app will use the http-server app-diras a default.</p><example>&lt;caucho.com&gt;&lt;http-server app-dir='c:\inetpub\wwwroot'&gt; ...&lt;/http-server&gt;&lt;/caucho.com&gt;</example><p>In the following, each user gets her own independentapplication using ~user.  (Note, since mod_caucho and IIS don't understandregexps, so you may need to manually configure the web server.)</p><example>&lt;host id=''>&lt;web-app url-regexp='/~([^/]*)'         app-dir='/home/$1/public_html'> ...&lt;/web-app>&lt;/host&gt;</example><p>By default, uses the subdiretory under the host app-dir with theapplication's name.</p></defun><defun title='browser-mapping' version="Resin 1.1"><p>Browser-specific configuration. Used to deal withbroken browsers.</p><deftable><tr><th>Attribute<th>Meaning<tr><td>regexp<td>Regular expression to match the User-Agent<tr><td>force10<td>If set, force HTTP/1.0</deftable><p>No default browser-mappings are defined.</p></defun><defun title='cache-mapping' version='Resin 1.1'><p>Specifies <var/Expires/> times for cacheable pages.Uncacheable pages, e.g. pages with sessions, are not affected.</p><deftable><tr><th>Attribute<th>Meaning<tr><td><var/url-pattern/><td>A pattern matching the url:<var//foo/*/>, <var//foo/>, or <var/*.foo/><tr><td>url-regexp<td>A regular expression matching the url<tr><td>expires<td>A time interval.</deftable><p>The time interval defaults to seconds, but will allow otherperiods:</p><deftable><tr><th>Suffix<th>Meaning<tr><td>s<td>seconds<tr><td>m<td>minutes<tr><td>h<td>hours<tr><td>d<td>days</deftable><example>&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><p>There is no default value.</p></defun><defun title="case-sensitive"><p>Specifies whether servlet-mapping and filter-mapping is treatedas case-sensitive or case-insensitive.</p><p><b>Default: </b> false on Windows, true on Unix.</p></defun><defun title="chain-mapping" index='chain-mapping' version="Resin 1.2.2"><p>Defines a Servlet filter to transform the output of anotherservlet based on mime-type.  By default, the content type<var/x-application/xsl/> executes com.caucho.jsp.XslFilter.</p><p>For example, a servlet could call<code/setContentType("x-application/xsl")/> to format its XML resultsusing XSL.</p><deftable><tr><th>Attribute<th>Description<tr><td>mime-type<td>The mime-type to match<tr><td>servlet-name<td>The servlet name to execute</deftable><example title='Filter XML by an XSL processor'>&lt;chain-mapping mime-type='x-application/xsl'                servlet-name='com.caucho.jsp.XslFilter'/&gt;</example><p><note>Versions before Resin 1.2.2 use <var/filter-mapping/> insteadof chain-mapping.  This has been changed to avoid conflicts withthe Servlet 2.3 spec</note></p><p>By default, Resin maps the x-application/xsl to com.caucho.jsp.XslFilter.</p></defun><defun name=classpath title='classpath' version="Resin 1.1"><p>Adds to the application-specific classpath. The classpathcan also automatically compile java classes when the <var/source/>attribute is specified.</p><note>Each <var/classpath/> directive must only contain a single classdirectory.  In other words, you need two <var/classpaths/> tospecify "foo.jar:bar.jar".</note><deftable><tr><th>Attribute<th>Description<th>Default<tr><td>id<td>Single class directory or jar<td>required<tr><td>library-dir<td>To be used as a jar directory like WEB-INF/lib<td>false<tr><td>source<td>Optional java source directory<td>same as id<tr><td>compile<td>Enable automatic compilation<td>true<tr><td>encoding<td>When compiling, what character encoding to use<td>javac default<tr><td>args<td>When compiling, additional args to javac<td>none</deftable><p>For example, to automatically compile classes in theWEB-INF/classes directory:</p><example title="Compile classes in WEB-INF/classes">&lt;classpath id='WEB-INF/classes'           source='WEB-INF/classes'	   compile='true'/></example><p>To compile classes into the WEB-INF/classes directory with thesource in a home work directory:</p><example>&lt;classpath id='WEB-INF/classes'           source='/home/ferg/ws/src'/>&lt;classpath id='/home/test/library/classes'/></example><p>By default, WEB-INF/classes is compiled and WEB-INF/lib contains jars.</p></defun><defun title='class-update-interval' version="Resin 1.1"><p>Interval in seconds between checking for servlet updates.For development, this can be set to 0 or to a small number to pick upnew servlet versions quickly.  For deployment, class-update-intervalcan be large to avoid the overhead of checking for updates.</p><p>The default value is 2 seconds.</p></defun><defun title='character-encoding' version="Resin 1.1"><p>Specifies the default character encoding for form parameters.</p><example>&lt;web-app id='/' character-encoding='shift_jis'&gt;  ...&lt;/web-app></example><p>The default value is ISO-8859-1.</p></defun><defun title='config-update-interval' version="Resin 2.0"><p>Interval in seconds between checking for configuration updates.For development, this can be set to 0 or to a small number to pick upnew configuration file versions quickly.For deployment, config-update-interval can be large to avoidthe overhead of checking for updates.</p><p>The default value is the value of class-update-interval.</p></defun><defun title='context-param' index='context-param' version="Servlet 2.2"><p>Initializes application variables.  <code/context-param/>defines initial values for <code>application.getInitParameter("foo")</code>.</p><p>The full servlet 2.2 syntax is supported and allows a simple shortcut</p><example>&lt;web-app id='/'&gt;&lt;context-param foo='bar'/&gt;&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;/web-app></example></defun><defun title='cookie-length' version="Resin 2.1.1"><p>Specifies the maximum length for the session's generated cookie.Only special situations like WAP devices should use this option.Reducing this value reduces the randomness in the cookie and increases thechance of session collisions.</p><p>Defaults to generate the maximum length of the cookie(64 random bits = 12 characters.)</p></defun><defun title='directory-servlet' version="Resin 1.2"><p>Specifies the servlet to use to display directories.  Todisable directory listing, set this to 'none'.</p><example>&lt;web-app id='/'&gt;  &lt;directory-servlet>none&lt;/directory-servlet>&lt;/web-app></example><p>The default is com.caucho.server.http.DirectoryServlet.</p></defun><defun title="ejb-ref" version="Servlet 2.2"><p>Instantiates a EJB client bean.  Normally, EJB clientsuse <a href="#jndi-link">jndi-link</a> instead.  There are<a href="ejb.xtp">EJB configuration</a> examples for some vendors.</p><deftable><tr><th>Attribute><th>Meaning<tr><td>ejb-ref-name<td>JNDI path attribute to store the bean<tr><td>ejb-ref-type<td>EJB class type<tr><td>ejb-ref-factory<td>Factory for creating an EJB client bean(Resin 1.2)<tr><td>init-param<td>Parameter for the factory (Resin 1.2)</deftable></defun><defun title="env-entry" version="Servlet 2.2"><p>JNDI parameter configuration. <var/env-entry/> binds JNDIvariables, similar to either:<a href="servlet-config.xtp#init-param">init-param</a> or<a href="#context-param">context param</a>.  <var/env-entry/> isuseful for configuring non-servlet-aware classes, like EJBs.</p><deftable><tr><th>Attribute<th>Meaning<tr><td>env-entry-name<td>JNDI path attribute to store the variable.  The path is relative to java:comp/env.<tr><td>env-entry-type<td>Java type of the variable<tr><td>env-entry-value<td>The variable value.</deftable><example title="Example resin.conf fragment">&lt;env-entry>  &lt;env-entry-name>max-price&lt;/env-entry-name>  &lt;env-entry-type>java.lang.Double&lt;/env-entry-type>  &lt;env-entry-value>22.27&lt;/env-entry-value>&lt;/env-entry></example><example title="Example test.jsp">&lt;%@ page import="javax.naming.*" %>&lt;%Context env = (Context) new InitialContext().lookup("java:comp/env");

⌨️ 快捷键说明

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