org.webmacro.servlet
Class Servlet22Broker
java.lang.Object
|
+--org.webmacro.Broker
|
+--org.webmacro.servlet.ServletBroker
|
+--org.webmacro.servlet.Servlet22Broker
- public class Servlet22Broker
- extends ServletBroker
An implementation of Broker tailored for Servlet 2.2
environments. Loads templates and other resources from the servlet
context (WAR file), writes log messages to the servlet log, and loads
properties from the WAR file context parameters.
- Since:
- 0.96
- Author:
- Brian Goetz
Fields inherited from class org.webmacro.Broker |
_config, _log, _ls, _myClassLoader, _name, _prof, _propertyOperators, _providers, _systemClassLoader, brokers, SETTINGS_PREFIX, WEBMACRO_DEFAULTS, WEBMACRO_PROPERTIES |
Constructor Summary |
protected |
Servlet22Broker(javax.servlet.ServletContext sc,
java.lang.ClassLoader cl)
Creates the broker looking in WEB-INF first
for WebMacro.properties before looking
in the application root. |
Method Summary |
java.lang.Class |
classForName(java.lang.String name)
Loads a class by name. |
static Broker |
getBroker(javax.servlet.Servlet s)
|
java.net.URL |
getResource(java.lang.String name)
Get a resource (file) from the the Broker's class loader |
java.io.InputStream |
getResourceAsStream(java.lang.String name)
Get a resource (file) from the Broker's class loader |
protected void |
loadServletSettings(java.lang.String prefix)
|
Methods inherited from class org.webmacro.Broker |
addProvider, findBroker, get, getBooleanSetting, getBroker, getBroker, getBrokerLocal, getEvaluationExceptionHandler, getFastWriter, getIntegerSetting, getIntegerSetting, getLog, getLog, getName, getProvider, getSetting, getSettings, getValue, init, initLog, loadDefaultSettings, loadSettings, loadSystemSettings, main, newProfile, register, setBrokerLocal, setEvaluationExceptionHandler, shutdown, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
_servletClassLoader
protected final java.lang.ClassLoader _servletClassLoader
Servlet22Broker
protected Servlet22Broker(javax.servlet.ServletContext sc,
java.lang.ClassLoader cl)
throws InitException
- Creates the broker looking in WEB-INF first
for WebMacro.properties before looking
in the application root.
loadServletSettings
protected void loadServletSettings(java.lang.String prefix)
throws InitException
getBroker
public static Broker getBroker(javax.servlet.Servlet s)
throws InitException
getResource
public java.net.URL getResource(java.lang.String name)
- Get a resource (file) from the the Broker's class loader
- Overrides:
getResource
in class Broker
getResourceAsStream
public java.io.InputStream getResourceAsStream(java.lang.String name)
- Get a resource (file) from the Broker's class loader
- Overrides:
getResourceAsStream
in class Broker
classForName
public java.lang.Class classForName(java.lang.String name)
throws java.lang.ClassNotFoundException
- Loads a class by name. Uses the servlet classloader to load the
class. If the class is not found uses the Broker classForName
implementation.
- Overrides:
classForName
in class Broker