EL configuration variables

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
[[Category:Configuration]]
+
{{Cleanup}} [[Category:Configuration]]
  
 
Resin configuration can use JSP EL variables in the resin.xml and resin-web.xml.
 
Resin configuration can use JSP EL variables in the resin.xml and resin-web.xml.
Line 26: Line 26:
 
The ${getenv} variable returns system environment variables.
 
The ${getenv} variable returns system environment variables.
  
   <mypkg:MyBean>
+
   <mypkg:MyBean xmlns:mypkg="urn:java:com.mycom.mypkg">
 
     <myValue>${getenv["MY_VAR"]}</myValue>
 
     <myValue>${getenv["MY_VAR"]}</myValue>
 
   </mypkg:MyBean>
 
   </mypkg:MyBean>
Line 82: Line 82:
  
  
   <mypkg:MyBean>
+
   <mypkg:MyBean xmlns:mypkg="urn:java:com.mycom.mypkg">
 
     <myValue>${system["user.name"]}</myValue>
 
     <myValue>${system["user.name"]}</myValue>
 
   </mypkg:MyBean>
 
   </mypkg:MyBean>
 +
 +
== webApp ==
 +
 +
Variables for a deployed web-app
 +
 +
; ${webApp.id}
 +
: The unique deployment identifier, like production/webapps/default/ROOT
 +
; ${webApp.name}
 +
: The name used for the war file like ROOT
 +
; ${webApp.root}
 +
: The root directory for the expanded war
 +
; ${webApp.contextPath}
 +
: The web-app's context path as returned by ServletRequest
 +
; ${webApp.regexp[0]}
 +
: Values for webapp-regexp matches
 +
; ${webApp.version}
 +
: The webapp version, if any

Latest revision as of 21:17, 1 December 2011

40px-Edit-clear.png This article requires cleanup and may refer to a legacy version of Resin.

Please visit http://www.caucho.com/documentation/ for the most up-to-date documentation.

Resin configuration can use JSP EL variables in the resin.xml and resin-web.xml.

Contents

[edit] EL Variables

getenv
System environment variables
host
Information from the virtual host
java
Contains JVM variables
resin
Contains top-level Resin configuration like ${resin.home}
system
Values from the Java System.getProperties
webApp
Information about the web-app
${__DIR__}
The directory of the current configuration file.
${__FILE__}
The current configuration file.

[edit] getenv

The ${getenv} variable returns system environment variables.

 <mypkg:MyBean xmlns:mypkg="urn:java:com.mycom.mypkg">
   <myValue>${getenv["MY_VAR"]}</myValue>
 </mypkg:MyBean>

[edit] host

The ${host} variable returns virtual host values

${host.name}
The name used for deployment in a hosts/ directory
${host.hostName}
The canonical DNS host name
${host.url}
The URL for the canonical host name
${host.regexp[0]}
For host-regexp matching, the n-th regexp expression
${host.root}
The virtual host's rootDirectory
${host.warDirectory}
The webapps/ directory in the virtual host

[edit] java

${java.home}
The Path to the JDK's home directory
${java.properties['user.name']}
Any System.getProperty("foo") value
${java.userName}
The value of System.getProperty("user.name")
${java.version}
The value of System.getProperty("java.version")

[edit] resin

${resin.address}
The address of the <server> configuration
${resin.conf}
The path to the Resin configuration file
${resin.home}
The Resin installation directory
${resin.port}
The port of the <server> configuration
${resin.root}
The Resin content root directory
${resin.serverId}
The unique server identifier specified by -server id
${resin.version}
The Resin version
${resin.versionDate}
The Resin build date

[edit] system

The Java System.getProperties values, which are set by the -Dfoo=xxx JVM arguments or set by the JVM itself.


 <mypkg:MyBean xmlns:mypkg="urn:java:com.mycom.mypkg">
   <myValue>${system["user.name"]}</myValue>
 </mypkg:MyBean>

[edit] webApp

Variables for a deployed web-app

${webApp.id}
The unique deployment identifier, like production/webapps/default/ROOT
${webApp.name}
The name used for the war file like ROOT
${webApp.root}
The root directory for the expanded war
${webApp.contextPath}
The web-app's context path as returned by ServletRequest
${webApp.regexp[0]}
Values for webapp-regexp matches
${webApp.version}
The webapp version, if any
Personal tools