📄 app-config.xtp
字号:
<tr><td>cookie-domain<td>Domain for session cookies (resin 1.2)<td>none<tr><td>cookie-max-age<td>Max age for persistent session cookies (resin 2.0)<td>none<tr><td>cookie-length<td>Maximum length of the cookie. (resin 2.1.1)<td>Integer.MAX_VALUE<tr><td>file-store<td>Persistent sessions using a file store (resin 1.2)<td>none<tr><td>jdbc-store<td>Persistent sessions using a JDBC store (resin 1.2)<td>none<tr><td>tcp-store<td>Persistent sessions using a distributed ring (resin 1.2)<td>none<tr><td>always-load-session<td>Reload data from the store on every request (resin 1.2)<td>false<tr><td>always-save-session<td>Save session data to the store on every request (resin 1.2)<td>false<tr><td>save-on-shutdown<td>Only save session when the application shuts down. (resin 1.2.3)<td>false<tr><td>reuse-session-id<td>Reuse the session id even if the session has timed out. (resin 2.0.4)<td>true<tr><td>ignore-serialization-errors<td>When persisting a session, ignore any values which don't implement java.io.Serializable<td>false<tr><td>invalidate-after-listener<td>Call listeners before the session is invalid<td>false</deftable><p>By default, both <code/enable-cookies/> and<code/enable-url-rewriting/> are true. To force url rewriting, youwould create a configuration like:</p><example><web-app id='/'> <session-config enable-cookies='false' enable-url-rewriting='true'/></web-app></example></defun><defun title='session-timeout' version="Servlet 2.2"><p>Sets the session timeout in minutes. Sessions idle forlonger than <code/session-timeout/> are purged.</p><p><code/session-timeout/> must be contained in a<code/session-config/> tag.</p><example><web-app id='/dir'> <session-config session-timeout='120'/></web-app></example><p>Defaults to 30 minutes.</p></defun><defun title='session-max' version="Servlet 2.2"><p>Sets the maximum number of active sessions. Sessions arestored in an LRU cache. When the cache fills, the oldest sessions arerecovered.</p><p><code/session-max/> must be contained in a<code/session-config/> tag.</p><example><web-app id='/dir'> <session-config> <session-timeout id=120/> <session-max id=4096/> </session-config></web-app></example><p>Defaults to 4096.</p></defun><defun title='taglib' version="Servlet 2.2"><p>Configures a JSP 1.1 tag library. See the <ahref='taglib.xtp'>tlb</a> configuration for details.</p><deftable><tr><th>Attribute<th>Description<tr><td>taglib-uri<td>Matching uri for the tag library<tr><td>taglib-location<td>Location for the tab library definition file.</deftable><p>The location is relative to the class path. In the following example,MyTag.tld should be in WEB-INF/classes/MyTag.tld.</p><example><taglib taglib-uri='/mytag/test' taglib-location='/MyTag.tld'/></example><p>The JSP file will use the tag library as follows:</p><example><%@ taglib prefix='x' uri='/mytag/test' %><x:mytag/></example><p>By default, looks up all WEB-INF/*.tld and META-INF/*.tld.</p></defun><defun title='tcp-store' version="Servlet 2.2"><p>Configure sessions to use a TCP-ring backing store. All the<srun> servers are arranged in a ring based on their order in theresin.conf. The <var/tcp-store/> will store the session based on thatring order.</p><example title="Example Symmetrical configuration"><http-server> <http id='a' port='80'/> <srun id='a' host='host-a' port='6802'/> <http id='b' port='80'/> <srun id='b' host='host-b' port='6802'/> <host id=''> <web-app id=''> <session-config> <tcp-store/> <always-load-session/> </session-config> </web-app> </host></http-server></example><p>The above example assumes the two hosts use an external load-balancer, likea router load-balancer.</p><p>See <a href="sessions.xtp">distributed sessions</a> for more details.</p><p>Disabled by default.</p></defun><defun title='temp-dir' version="Resin 1.1"><p>Application temp directory. This is the path used in<var/javax.servlet.context.tempdir/>.</p><p><b>Default:</b> Defaults to <var/WEB-INF/tmp/>.</p></defun><defun title='url-pattern' version="Servlet 2.2"><p>Matches a set of URLs for servlet-mapping.</p><deftable><tr><th width='25%'>Pattern<th>Description<tr><td>/foo/bar.html<td>Matches exactly the /foo/bar.html URL.<tr><td>/foo/*<td>Matches /foo and any children<tr><td>*.foo<td>Matches any URL with a .foo extension<tr><td>/<td>Replaces the default servlet.</deftable><p><var///> defines a default handler and <var//*/> defines a prefix handler.<var//*/> will override extension handlers like <var/*.foo/>. <var///>will only be used if no other pattern matches.</p><p>No default. Either url-pattern or url-regexp is required.</p></defun><defun title="resource-ref" version="Servlet 2.2"><p>Database pooling configuration. <var/resource-ref/> putsthe DataSource in a JNDI context and also in the ServletContext.Each web-app can configure its own database pool. Resin can alsoshare a common pool by putting the resource-ref outside the http-server.</p><p>More details are in the <a href='db-config.xtp'>database config</a>page.</p><p>The driver can be in WEB-INF/lib or WEB-INF/classes, although it'sa better idea to put it in the global classpath or resin-2.0.x/lib.</p><deftable><tr><th>Attribute<th>Meaning<tr><td>res-ref-name<td>JNDI path attribute to store the pool. The path is relative to java:comp/env.<tr><td>res-type<td>javax.sql.DataSource or javax.sql.XADataSource for database pools<tr><td>init-param<td>initialization parameters (Resin 1.2)<tr><td>init-class<td>Class containing init params (Map or Hashtable) (Resin 1.2.4)<tr><td>bean-name<td>optional bean class to be used as a resource (Resin 1.2)</deftable><p><var/init-param/> sets bean properties of the data source.You can look at the com.caucho.sql.DBPool JavaDoc for its interface.Unknown parameters are used to set the driver properties. So you canset any driver-specific property in the init-param.</p><deftable title="DBPool Init Parameters"><tr><th>Attribute<th>Meaning<th>Default<tr><td>driver-name<td>JDBC driver class<td>required<tr><td>url<td>JDBC url for the database<td>required<tr><td>user<td>Database user<td>""<tr><td>password<td>Database password<td>""<tr><td>max-connections<td>Maximum number of allowed connections<td>20<tr><td>max-idle-time<td>Maximum time an idle connection is kept inthe pool<td>30 sec<tr><td>connection-wait-time<td>How long to wait for an idle connection (Resin 1.2.3)<td>10 minutes<tr><td>max-overflow-connections<td>How many "overflow" connection are allowed if the connection wait times out.<td>0<tr><td>ping-table<td>The database table used to "ping", checking thatthe connection is still live.<td>false<tr><td>ping-on-reuse<td>Test for live connections before allocatingthem from the pool.<td>false<tr><td>ping-on-free<td>Test for live connections before replacingthem in the pool.<td>false<tr><td>ping-on-idle<td>Periodically test connections in the pool<td>false<tr><td><var/any other/><td>calls DBPool.setProperty() to set driver properties.<td>none</deftable><p>Here's a sample minimal resin.conf fragment to bind a DBPool-baseddatabase to the JNDI path "java:comp/env/jdbc/test".</p><example title="Sample resin.conf fragment"><resource-ref> <res-ref-name>jdbc/test</res-ref-name> <res-type>javax.sql.DataSource</res-type> <init-param driver-name="org.gjt.mm.mysql.Driver"/> <init-param url="jdbc:mysql://localhost:3306/test"/></resource-ref></example><p>The following is a sample design pattern for getting new databaseconnections. The <var/try ... finally/> block is very important formaking database connections reliable.</p><example title="Sample test.jsp to use database connections"><%@ page import='javax.sql.*, javax.naming.*, java.sql.*' %><%Context env = (Context) new InitialContext().lookup("java:comp/env");DataSource source = (DataSource) env.lookup("jdbc/test");Connection conn = source.getConnection();try { ...} finally { conn.close();}%></example></defun><defun title='path-mapping' version="Servlet 2.2"><p>Maps url patterns to real paths. If using a server likeIIS, you may need to match the server's path aliases.</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>real-path<td>The prefix of the real path. When used with url-regexp, allows substitution variables like <var/$1/>.</deftable><example><web-app id='/'><path-mapping url-pattern='/resin/*' real-path='e:\resin'/><path-mapping url-regexp='/~([^/]*)' real-path='e:\home\$1'/></web-app></example></defun><defun title='secure' version="Resin 2.0.6"><p>Requires that the web-app be only accessed from a secureconnection, e.g. SSL.</p></defun><defun title="stderr-log" version="Resin 2.0.2"><p>Configures the location for System.err for the current web-app.The stdout-log may be put in the <host> or <http-server> contextto apply to all web-apps within that context.</p><example><web-app> <stdout-log href='$app-dir/WEB-INF/logs/stdout.log'/> ...</web-app></example><deftable><tr><th>attribute<th>meaning<tr><td>href<td>The location of the file. Path variables may be used.<tr><td>rollover-period<td>How often the log should be rotated.<tr><td>rollover-size<td>The maximum size of the log before rotation.<tr><td>timestamp<td>Timestamp before each line (Resin 2.0.3)<tr><td>encoding<td>Character encoding</deftable></defun><defun title="stdout-log" version="Resin 2.0.2"><p>Configures the location for System.out for the current web-app.The stdout-log may be put in the <host> or <http-server> contextto apply to all web-apps within that context.</p><example><web-app> <stdout-log href='$app-dir/WEB-INF/logs/stdout.log'/> ...</web-app></example><deftable><tr><th>attribute<th>meaning<tr><td>href<td>The location of the file. Path variables may be used.<tr><td>rollover-period<td>How often the log should be rotated.<tr><td>rollover-size<td>The maximum size of the log before rotation.<tr><td>timestamp<td>Timestamp before each line (Resin 2.0.3)</deftable></defun><defun title="strict-mapping" version="Resin 1.2"><p>Forces servlet-mapping to follow strict Servlet 2.2, disallowingPATH_INFO.</p><p><b>Default:</b> Defaults to false, allowing /foo/bar.jsp/foo.</p></defun><defun title="welcome-file-list" version="Servlet 2.2"><p>Sets the files to use as index.jsp pages.According to the spec, each file is in a <welcome-file> element.</p><example><web-app id='/'> <welcome-file-list> <welcome-file>index.jsp<welcome-file> <welcome-file>index.xtp<welcome-file> <welcome-file>home.xtp<welcome-file> </welcome-file-list></web-app></example><p>Resin also provides a shortcut where you can just list the files:</p><example><web-app id='/'> <welcome-file-list>index.jsp, index.xtp, home.xtp</welcome-file-list></web-app></example><p><b>Default:</b> Defaults to index.xtp, index.jsp, index.html.</p></defun><defun title='web-xml' version="Resin 2.0"><p>Lets applications specify the web.xml file.</p><p><b>Default:</b> Defaults to web.xml.</p></defun><defun title='work-dir' version="Resin 2.0.0"><p>Application work directory. This is the directory used forgenerated code like JSP, XSL and EJB classes.</p><p><b>Default:</b> Defaults to <var/WEB-INF/work/>.</p></defun></s2></s1>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -