public class TilesPlugin extends Object implements PlugIn
TilesRequestProcessor
.
TilesRequestProcessor
as
request processor. If you want to use your own RequestProcessor,
it should subclass TilesRequestProcessor.
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.Modifier and Type | Field and Description |
---|---|
protected 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 String |
tilesUtilImplClassname
Tiles util implementation classname.
|
Constructor and Description |
---|
TilesPlugin() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
End plugin.
|
protected Map |
findStrutsPlugInConfigProperties(ActionServlet servlet,
ModuleConfig config)
Find original properties set in the Struts PlugInConfig object.
|
String |
getTilesUtilImplClassname()
Get Tiles util implemention classname.
|
void |
init(ActionServlet servlet,
ModuleConfig moduleConfig)
Receive notification that the specified module is being
started up.
|
protected void |
initRequestProcessorClass(ModuleConfig config)
Set RequestProcessor to appropriate Tiles
RequestProcessor . |
boolean |
isModuleAware()
Get the module aware flag.
|
protected DefinitionsFactoryConfig |
readFactoryConfig(ActionServlet servlet,
ModuleConfig config)
Create FactoryConfig and initialize it from web.xml and struts-config.xml.
|
void |
setCurrentPlugInConfigObject(PlugInConfig plugInConfigObject)
Method used by the ActionServlet initializing this plugin.
|
void |
setModuleAware(boolean moduleAware)
Set the module aware flag.
|
void |
setTilesUtilImplClassname(String tilesUtilImplClassname)
Set Tiles util implemention classname.
|
protected static org.apache.commons.logging.Log log
protected boolean moduleAware
protected String tilesUtilImplClassname
protected DefinitionsFactory definitionFactory
protected PlugInConfig currentPlugInConfigObject
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(ActionServlet servlet, ModuleConfig moduleConfig) throws javax.servlet.ServletException
Receive notification that the specified module is being started up.
init
in interface 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.protected DefinitionsFactoryConfig readFactoryConfig(ActionServlet servlet, 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 Map findStrutsPlugInConfigProperties(ActionServlet servlet, 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(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(String tilesUtilImplClassname)
moduleAware
will not be used anymore.tilesUtilImplClassname
- Classname.public String getTilesUtilImplClassname()
null
if none is set.public void setCurrentPlugInConfigObject(PlugInConfig plugInConfigObject)
plugInConfigObject
- PlugInConfig.Copyright © 2000–2016 Apache Software Foundation. All rights reserved.