📄 el-var.xtp
字号:
<tr> <td>%S</td> <td>seconds</td></tr><tr> <td>%s</td> <td>milliseconds</td></tr><tr> <td>%W</td> <td>week in year (three-digit)</td></tr><tr> <td>%w</td> <td>day of week (one-digit)</td></tr><tr> <td>%y</td> <td>year (two-digit)</td></tr><tr> <td>%Y</td> <td>year (four-digit)</td></tr><tr> <td>%Z</td> <td>time zone (name)</td></tr><tr> <td>%z</td> <td>time zone (+/-0800)</td></tr></deftable></defun> <!-- timestamp --><defun title="host"><deftable title="host properties"><tr> <th>variable</th> <th>meaning</th></tr><tr> <td>name</td> <td>The name of the host</td></tr><tr> <td>regexp</td> <td>Regular expression values for host regexp matches</td></tr><tr> <td>root</td> <td>The root directory of the host</td></tr><tr> <td>url</td> <td>The canonical url of the host</td></tr></deftable><s2 title="Example"><example><host regexp="www.([^.]+).com"> <root-directory>/opt/www/${host.regexp[1]}</root-directory> <context-param server-id="${server.name}"/> <web-app id="/"> <document-directory>webapps/ROOT</document-directory> </web-app></host></example></s2></defun><defun title="java"><deftable title="java properties"><tr> <th>variable</th> <th>meaning</th></tr><tr> <td>version</td> <td>The JDK version</td></tr></deftable></defun><defun title="jndi()"><p>The configuration EL supports the static function jndi:lookup.jndi:lookup can be used to lookup a JNDI value for the configuration.</p><example title="configuring JNDI"><servlet servlet-name='foo' servlet-class='qa.FooServlet'> <init> <data-source>${jndi:lookup("java:comp/env/jdbc/test")}</data-source> </init></servlet></example></defun> <!-- jndi:lookup --><defun title="resin"><deftable title="resin properties"><tr> <th>variable</th> <th>meaning</th></tr><tr> <td>address</td> <td>The local IP address</td></tr><tr> <td>conf</td> <td>Path to the configuration file</td></tr><tr> <td>home</td> <td>The the location of the Resin executables</td></tr><tr> <td>hostname</td> <td>The local hostname as returned by InetAddress</td></tr><tr> <td>root</td> <td>The location of the content, specified at startup with --resin-root</td></tr><tr> <td>serverId</td> <td>The identity of the active <server>, specified at startup with --server</td></tr><tr> <td>version</td> <td>The resin version, e.g. 3.1.0</td></tr></deftable></defun><defun title="server"><p>Values related to the active <a href="server-tags.xtp"><server></a>.</p><deftable title="server properties"><tr> <th>variable</th> <th>meaning</th></tr><tr> <td>address</td> <td>the bind address of the cluster and load balancing port</td></tr><tr> <td>id</td> <td>The identity of the active <server>, specified at startup with --server</td></tr><tr> <td>port</td> <td>the cluster and load balancing port</td></tr><tr> <td>httpAddress</td> <td>the bind address of the http listener, INADDR_ANY for all addresses</td></tr><tr> <td>httpPort</td> <td>the port number of the http listener</td></tr><tr> <td>httpsAddress</td> <td>the bind address of the ssl http listener, INADDR_ANY for all addresses</td></tr><tr> <td>httpsPort</td> <td>the port number of the ssl http listener</td></tr></deftable></defun><defun title="System properties"><p>System properties are available as variables in el expressions.Many system property names are not valid elidentifiers; in that case the <var>system</var> variable is used, for example<code>${system['java.io.tmpdir']}</code>.</p><p>A full list of standard java system properties is provided in the javadoc for<a href="javadoc|java.lang.System">java.lang.System</a>.</p><deftable title="Standard system properties"><tr> <th>variable</th> <th>meaning</th></tr><tr> <td>java.io.tmpdir</td> <td>Default temp file path</td></tr><tr> <td>os.name</td> <td>Operating system name</td></tr><tr> <td>os.arch</td> <td>Operating system architecture</td></tr><tr> <td>os.version</td> <td>Operating system version</td></tr><tr> <td>user.name</td> <td>User's account name</td></tr><tr> <td>user.home</td> <td>User's home directory</td></tr><tr> <td>user.dir</td> <td>User's current working directory</td></tr></deftable></defun><defun title="webApp"><deftable title="webApp properties"><tr> <th>variable</th> <th>meaning</th></tr><tr> <td>name</td> <td>The name of the web-app</td></tr><tr> <td>contextPath</td> <td>The context path of the web-app</td></tr><tr> <td>regexp</td> <td>Regular expression values for web-app regexp matches</td></tr><tr> <td>root</td> <td>The root directory of the web-app</td></tr><tr> <td>url</td> <td>The canonical url of the web app</td></tr></deftable></defun><!--<s1 name="functions" title="Functions"><p>Static functions are available in EL expressions. Resin also makes utilityobjects avilable as EL variables that provide functions as methods.</p><s2 title="jndi"><s3 title="jndi:lookup" type="defun"><p>The configuration EL supports a the static function jndi:lookup.jndi:lookup can be used to lookup a JNDI value for the configuration.</p><example title="configuring JNDI"><servlet servlet-name='foo' servlet-class='qa.FooServlet'> <init> <data-source>${jndi:lookup("java:comp/env/jdbc/test")}</data-source> </init></servlet></example></s3></s2><s2 title="fmt"><p>The EL Environment contains a <var>fmt</var> object, which has a number ofuseful formatting methods.</p><s3 title="fmt.timestamp()" type="defun"><p>Format a timestamp string.</p><example>fmt.timestamp(format[,date])</example><deftable-parameters><tr><td>format</td><td>the format string (see below)</td><td>required</td></tr><tr><td>date</td><td>an object with <a href="javadoc|java.util.Date|"/> or <a href="javadoc|java.util.Calendar|"/> or <a href="javadoc|com.caucho.util.QDate|"/></td><td>the current date and time</td></tr></deftable-parameters><example>msg="The current date and time is ${fmt.timestamp('%Y/%m/%d %H:%M:%S.%s')}"msg="time=${fmt.timestamp('[%Y/%m/%d %H:%M:%S.%s]')}"</example><p><code>format</code> contains regular characters, which are just copied tothe output string, and percent codes which are substituted with time and datevalues.</p><deftable><tr><th>Code</th><th>Meaning</th></tr><tr><td>%a</td><td>day of week (short)</td></tr><tr><td>%A</td><td>day of week (verbose)</td></tr><tr><td>%b</td><td>day of month (short)</td></tr><tr><td>%B</td><td>day of month (verbose)</td></tr><tr><td>%c</td><td>Java locale date</td></tr><tr><td>%d</td><td>day of month (two-digit)</td></tr><tr><td>%H</td><td>24-hour (two-digit)</td></tr><tr><td>%I</td><td>12-hour (two-digit)</td></tr><tr><td>%j</td><td>day of year (three-digit)</td></tr><tr><td>%m</td><td>month (two-digit)</td></tr><tr><td>%M</td><td>minutes</td></tr><tr><td>%p</td><td>am/pm</td></tr><tr><td>%S</td><td>seconds</td></tr><tr><td>%s</td><td>milliseconds</td></tr><tr><td>%W</td><td>week in year (three-digit)</td></tr><tr><td>%w</td><td>day of week (one-digit)</td></tr><tr><td>%y</td><td>year (two-digit)</td></tr><tr><td>%Y</td><td>year (four-digit)</td></tr><tr><td>%Z</td><td>time zone (name)</td></tr><tr><td>%z</td><td>time zone (+/-0800)</td></tr></deftable></s3><s3 title="fmt.sprintf()" type="defun"><p>Format a string using a sprintf-like format string.</p><def>fmt.sprintf(format[,arg1, arg2 ... argN])</def><deftable-parameters><tr><td>format</td><td>the format string (see below)</td><td>required</td></tr><tr><td>arg1..argN</td><td>the values used for the conversions in the format string</td><td>n/a</td></tr></deftable-parameters><p><code>sprintf</code> accepts a series of arguments, applies to each a format specifier from `format', and returns the formatted data as a string.`format' is a string containing two types of objects: ordinarycharacters (other than `%'), which are copied unchanged to the output, andconversion specifications, each of which is introduced by `%'. (To include`%' in the output, use `%%' in the format string). </p><p>A conversion specification has the following form:</p><def>%[FLAGS][WIDTH][.PREC][TYPE]</def><p>TYPE is required, the rest are optional.</p><p>The following TYPE's are supported:</p><deftable><tr><td>%%</td><td>a percent sign</td></tr><tr><td>%c</td><td>a character with the given number</td></tr><tr><td>%s</td><td>a string, a null string becomes "#null"</td></tr><tr><td>%z</td><td>a string, a null string becomes the empty string ""</td></tr><tr><td>%d</td><td>a signed integer, in decimal</td></tr><tr><td>%o</td><td>an integer, in octal</td></tr><tr><td>%u</td><td>an integer, in decimal</td></tr><tr><td>%x</td><td>an integer, in hexadecimal</td></tr><tr><td>%X</td><td>an integer, in hexadecimal using upper-case letters</td></tr><tr><td>%e</td><td>a floating-point number, in scientific notation</td></tr><tr><td>%E</td><td>a floating-point number, like %e with an upper-case "E"</td></tr><tr><td>%f</td><td>a floating-point number, in fixed decimal notation</td></tr><tr><td>%g</td><td>a floating-point number, in %e or %f notation</td></tr><tr><td>%G</td><td>a floating-point number, like %g with an upper-case "E"</td></tr><tr><td>%p</td><td>a pointer (outputs a value like the default of toString())</td></tr></deftable><p>Intepret the word `integer' to mean the java type long. Since java does not support unsigned integers, all integers are treated the same.</p><p>The following optional FLAGS are supported:</p><deftable><tr><td>0</td><td>If the TYPE character is an integer leading zeroes are used to pad the field width instead of spaces (following any indication of sign or base).</td></tr><tr><td>+</td><td>Include a `+' with positive numbers.</td></tr><tr><td>(a space)</td><td>use a space placeholder for the `+' that would result from a positive number</td></tr><tr><td>-</td><td>The result of is left justified, and the right is padded with blanks until the result is `WIDTH' in length. If you do not use this flag, the result is right justified, and padded on the left.</td></tr><tr><td>#</td><td>an alternate display is used, for `x' and `X' a non-zero result will have an "0x" prefix; for floating point numbers the result will always contain a decimal point.</td></tr><tr><td>j</td><td>escape a string suitable for a Java string, or a CSV file. The following escapes are applied: " becomes \", newline becomes \n, return becomes \r, \ becomes \\.</td></tr><tr><td>v</td><td>escape a string suitable for CSV files, the same as `j' with an additional <code>"</code> placed at the beginning and ending of the string</td></tr><tr><td>m</td><td>escape a string suitable for a XML file. The following escapes are applied: < becomes &lt;, > becomes &gt; & becomes &amp; ' becomes &#039, " becomes &034;</td></tr></deftable><p>The optional WIDTH argument specifies a minium width for the field.Spaces are used unless the `0' FLAG was used to indicate 0 padding.</p><p>The optional PREC argument is introduced with a `.', and gives the maximum number of characters to print; or the minimumnumber of digits to print for integer and hex values; or the maximum number of significant digits for `g' and `G'; or the number of digits to print after the decimal point for floating points.</p></s3></s2></s1>--></body></document>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -