|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.tiles.TilesPlugin
public class TilesPlugin
Tiles Plugin used to initialize Tiles.
This plugin is to be used with Struts 1.1 in association with
TilesRequestProcessor
.
This plugin creates one definition factory for each Struts-module. The definition factory
configuration is read first from 'web.xml' (backward compatibility), then it is
overloaded with values found in the plugin property values.
The plugin changes the Struts configuration by specifying a TilesRequestProcessor
as
request processor. If you want to use your own RequestProcessor,
it should subclass TilesRequestProcessor.
This plugin can also be used to create one single factory for all modules.
This behavior is enabled by specifying moduleAware=false
in each
plugin properties. In this case, the definition factory
configuration file is read by the first Tiles plugin to be initialized. The order is
determined by the order of modules declaration in web.xml. The first module
is always the default one if it exists.
The plugin should be declared in each struts-config.xml file in order to
properly initialize the request processor.
Field Summary | |
---|---|
protected org.apache.struts.config.PlugInConfig |
currentPlugInConfigObject
The plugin config object provided by the ActionServlet initializing this plugin. |
protected DefinitionsFactory |
definitionFactory
Associated definition factory. |
protected static org.apache.commons.logging.Log |
log
Commons Logging instance. |
protected boolean |
moduleAware
Is the factory module aware? |
protected java.lang.String |
tilesUtilImplClassname
Tiles util implementation classname. |
Constructor Summary | |
---|---|
TilesPlugin()
|
Method Summary | |
---|---|
void |
destroy()
End plugin. |
protected java.util.Map |
findStrutsPlugInConfigProperties(org.apache.struts.action.ActionServlet servlet,
org.apache.struts.config.ModuleConfig config)
Find original properties set in the Struts PlugInConfig object. |
java.lang.String |
getTilesUtilImplClassname()
Get Tiles util implemention classname. |
void |
init(org.apache.struts.action.ActionServlet servlet,
org.apache.struts.config.ModuleConfig moduleConfig)
Receive notification that the specified module is being started up. |
protected void |
initRequestProcessorClass(org.apache.struts.config.ModuleConfig config)
Set RequestProcessor to appropriate Tiles RequestProcessor . |
boolean |
isModuleAware()
Get the module aware flag. |
protected DefinitionsFactoryConfig |
readFactoryConfig(org.apache.struts.action.ActionServlet servlet,
org.apache.struts.config.ModuleConfig config)
Create FactoryConfig and initialize it from web.xml and struts-config.xml. |
void |
setCurrentPlugInConfigObject(org.apache.struts.config.PlugInConfig plugInConfigObject)
Method used by the ActionServlet initializing this plugin. |
void |
setModuleAware(boolean moduleAware)
Set the module aware flag. |
void |
setTilesUtilImplClassname(java.lang.String tilesUtilImplClassname)
Set Tiles util implemention classname. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
protected boolean moduleAware
protected java.lang.String tilesUtilImplClassname
protected DefinitionsFactory definitionFactory
protected org.apache.struts.config.PlugInConfig currentPlugInConfigObject
Constructor Detail |
---|
public TilesPlugin()
Method Detail |
---|
public boolean isModuleAware()
true
: user wants a single factory instance,
false:
user wants multiple factory instances (one per module with Struts)public void setModuleAware(boolean moduleAware)
tilesUtilImplClassname
is not
set.
moduleAware
- true
: user wants a single factory instance,
false:
user wants multiple factory instances (one per module with Struts)public void init(org.apache.struts.action.ActionServlet servlet, org.apache.struts.config.ModuleConfig moduleConfig) throws javax.servlet.ServletException
Receive notification that the specified module is being started up.
init
in interface org.apache.struts.action.PlugIn
servlet
- ActionServlet that is managing all the modules
in this web application.moduleConfig
- ModuleConfig for the module with which
this plugin is associated.
javax.servlet.ServletException
- if this PlugIn
cannot
be successfully initialized.public void destroy()
destroy
in interface org.apache.struts.action.PlugIn
protected DefinitionsFactoryConfig readFactoryConfig(org.apache.struts.action.ActionServlet servlet, org.apache.struts.config.ModuleConfig config) throws javax.servlet.ServletException
servlet
- ActionServlet that is managing all the modules
in this web application.config
- ModuleConfig for the module with which
this plugin is associated.
javax.servlet.ServletException
- if this PlugIn
cannot
be successfully initialized.protected java.util.Map findStrutsPlugInConfigProperties(org.apache.struts.action.ActionServlet servlet, org.apache.struts.config.ModuleConfig config) throws javax.servlet.ServletException
servlet
- ActionServlet that is managing all the modules
in this web application.config
- ModuleConfig for the module with which
this plug in is associated.
javax.servlet.ServletException
- if this PlugIn
cannot
be successfully initialized.protected void initRequestProcessorClass(org.apache.struts.config.ModuleConfig config) throws javax.servlet.ServletException
RequestProcessor
.
First, check if a RequestProcessor is specified. If yes, check if it extends
the appropriate TilesRequestProcessor
class. If not, set processor class to
TilesRequestProcessor.
config
- ModuleConfig for the module with which
this plugin is associated.
javax.servlet.ServletException
- On errors.public void setTilesUtilImplClassname(java.lang.String tilesUtilImplClassname)
moduleAware
will not be used anymore.
tilesUtilImplClassname
- Classname.public java.lang.String getTilesUtilImplClassname()
null
if none is set.public void setCurrentPlugInConfigObject(org.apache.struts.config.PlugInConfig plugInConfigObject)
plugInConfigObject
- PlugInConfig.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |