EL configuration variables

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
[[Category:Configuration]]
 
[[Category:Configuration]]
  
= Globally Available Variables =
+
Resin configuration can use JSP EL variables in the resin.xml and resin-web.xml.
  
{|
+
; getenv
!Variable||Meaning
+
: System environment variables
|-
+
; host
||__FILE__||The current configuration file
+
: 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.
  
= Globally Available Functions =
+
== getenv ==
  
{|
+
The ${getenv} variable returns system environment variables.
!Function||Description
+
|-
+
||class_exists||True if the specified class exists in the environment
+
|-
+
||jndi||Looks up a resource in the JNDI environment
+
|-
+
||jndi_lookup||Synonym for jndi
+
|}
+
  
= <resin> environment Variables =
+
  <mypkg:MyBean>
 +
    <myValue>${getenv["MY_VAR"]}</myValue>
 +
  </mypkg:MyBean>
  
{|
+
== host ==
!Variable||Description
+
|-
+
||java||Information about the JDK version (3.0.17)
+
|-
+
||resin||The Resin variable object (see com.caucho.server.resin.ResinServer$Var)
+
|-
+
||resinHome||The Resin binary and library home
+
|-
+
||serverRoot||The root of the deployment/application data (defaults to to resinHome)
+
|}
+
  
The java object has the following methods
+
The ${host} variable returns virtual host values
  
{|
+
; ${host.name}
!Method||Description
+
: The name used for deployment in a hosts/ directory
|-
+
; ${host.hostName}
||isJava5()||True if the JDK supports JDK 1.5 or later (3.0.17)
+
: 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
  
The resin object has the following methods
+
== java ==
  
{|
+
; ${java.home}
!Method||Description
+
: The [[Path]] to the JDK's home directory
|-
+
; ${java.properties['user.name']}
||id||returns the value of -server on the command line (3.0.15)
+
: Any System.getProperty("foo") value
|-
+
; ${java.userName}
||home||returns [-resin-home]
+
: The value of System.getProperty("user.name")
|-
+
; ${java.version}
||root||returns the deployment root directory, [-server-root] (3.0.15)
+
: The value of System.getProperty("java.version")
|-
+
||rootDir||return the deployment root directory (same as resin.root)
+
|-
+
||isProfessional()||returns true for a valid Resin professional installation
+
|}
+
  
= <server> environment Variables =
+
== resin ==
  
{|
+
; ${resin.address}
!Variable||Description
+
: The address of the <server> configuration
|-
+
; ${resin.conf}
||server||information about the server environment
+
: The path to the Resin configuration file
|}
+
; ${resin.home}
 
+
: The Resin installation directory
The server variable has a number of fields/methods available (defined in com.caucho.server.resin.ServerController$Var)
+
; ${resin.port}
 
+
: The port of the <server> configuration
{|
+
; ${resin.root}
!Attribute||Description
+
: The Resin content root directory
|-
+
; ${resin.serverId}
||id||The value of -server id from the command line
+
: The unique server identifier specified by -server id
|-
+
; ${resin.version}
||root||Returns the server's data directory, [-server-root] (3.0.15)
+
: The Resin version
|-
+
; ${resin.versionDate}
||rootDir||The server's root directory (same as server.root)
+
; The Resin build date
|}
+
 
+
= <host> environment variables =
+
 
+
{|
+
!Variable||Description
+
|-
+
||host||information about the host environment
+
|}
+
 
+
{|
+
!Method||Description
+
|-
+
||root||the host's root directory (3.0.15)
+
|-
+
||rootDir||the host's root directory (same as host.root)
+
|-
+
||hostName||the host's canonical name
+
|-
+
||URL||the host's URL
+
|-
+
||regexp||any regular expression values for a host-regexp
+
|}
+
 
+
= <web-app> environment variables =
+
 
+
{|
+
!Variable||Description
+
|-
+
||webapp||information about the web-app environment
+
|}
+
 
+
{|
+
!Method||Description
+
|-
+
||id||the web-app's unique name
+
|-
+
||name||the name of the war file (minus the .war)
+
|-
+
||root||the root of the web-app's directory
+
|-
+
||rootDir||the root of the web-app's directory (same as webapp.root)
+
|-
+
||contextPath||the web-app's context path
+
|-
+
||regexp||any regexp values from a url-regexp
+
|}
+

Revision as of 19:46, 2 October 2010


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

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.

Contents

getenv

The ${getenv} variable returns system environment variables.

 <mypkg:MyBean>
   <myValue>${getenv["MY_VAR"]}</myValue>
 </mypkg:MyBean>

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

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")

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
Personal tools