org.apache.struts.tiles
クラス TilesRequestProcessor

java.lang.Object
  拡張org.apache.struts.action.RequestProcessor
      拡張org.apache.struts.tiles.TilesRequestProcessor

public class TilesRequestProcessor
extends RequestProcessor

RequestProcessor contains the processing logic that the Struts controller servlet performs as it receives each servlet request from the container.

This processor subclasses the Struts RequestProcessor in order to intercept calls to forward or include. When such calls are done, the Tiles processor checks if the specified URI is a definition name. If true, the definition is retrieved and included. If false, the original URI is included or a forward is performed.

Actually, catching is done by overloading the following methods:

導入されたバージョン:
Struts 1.1

フィールドの概要
protected  DefinitionsFactory definitionsFactory
          Definitions factory.
protected static org.apache.commons.logging.Log log
          Commons Logging instance.
 
クラス org.apache.struts.action.RequestProcessor から継承したフィールド
actions, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, moduleConfig, servlet
 
コンストラクタの概要
TilesRequestProcessor()
           
 
メソッドの概要
protected  void doForward(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Do a forward using request dispatcher.
 DefinitionsFactory getDefinitionsFactory()
          Get associated definition factory.
 void init(ActionServlet servlet, ModuleConfig moduleConfig)
          Initialize this request processor instance.
protected  void initDefinitionsMapping()
          Read component instance mapping configuration file.
protected  void internalModuleRelativeForward(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Catch the call to a module relative forward.
protected  void internalModuleRelativeInclude(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Do a module relative include to specified uri using request dispatcher.
protected  void processForwardConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ForwardConfig forward)
          Overloaded method from Struts' RequestProcessor.
protected  boolean processTilesDefinition(java.lang.String definitionName, boolean contextRelative, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process a Tile definition name.
 
クラス org.apache.struts.action.RequestProcessor から継承したメソッド
destroy, doInclude, getInternal, getServletContext, log, log, process, processActionCreate, processActionForm, processActionPerform, processCachedMessages, processContent, processException, processForward, processInclude, processLocale, processMapping, processMultipart, processNoCache, processPath, processPopulate, processPreprocess, processRoles, processValidate
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

definitionsFactory

protected DefinitionsFactory definitionsFactory
Definitions factory.


log

protected static org.apache.commons.logging.Log log
Commons Logging instance.

コンストラクタの詳細

TilesRequestProcessor

public TilesRequestProcessor()
メソッドの詳細

init

public void init(ActionServlet servlet,
                 ModuleConfig moduleConfig)
          throws javax.servlet.ServletException
Initialize this request processor instance.

オーバーライド:
クラス RequestProcessor 内の init
パラメータ:
servlet - The ActionServlet we are associated with.
moduleConfig - The ModuleConfig we are associated with.
例外:
javax.servlet.ServletException - If an error occurs during initialization.

initDefinitionsMapping

protected void initDefinitionsMapping()
                               throws javax.servlet.ServletException
Read component instance mapping configuration file. This is where we read files properties.

例外:
javax.servlet.ServletException

processTilesDefinition

protected boolean processTilesDefinition(java.lang.String definitionName,
                                         boolean contextRelative,
                                         javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.http.HttpServletResponse response)
                                  throws java.io.IOException,
                                         javax.servlet.ServletException
Process a Tile definition name. This method tries to process the parameter definitionName as a definition name. It returns true if a definition has been processed, or false otherwise. Parameter contextRelative is not used in this implementation.

パラメータ:
definitionName - Definition name to insert.
contextRelative - Is the definition marked contextRelative ?
request - Current page request.
response - Current page response.
戻り値:
true if the method has processed uri as a definition name, false otherwise.
例外:
java.io.IOException
javax.servlet.ServletException

doForward

protected void doForward(java.lang.String uri,
                         javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)
                  throws java.io.IOException,
                         javax.servlet.ServletException
Do a forward using request dispatcher. Uri is a valid uri. If response has already been commited, do an include instead.

オーバーライド:
クラス RequestProcessor 内の doForward
パラメータ:
uri - Uri or Definition name to forward.
request - Current page request.
response - Current page response.
例外:
java.io.IOException
javax.servlet.ServletException

processForwardConfig

protected void processForwardConfig(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    ForwardConfig forward)
                             throws java.io.IOException,
                                    javax.servlet.ServletException
Overloaded method from Struts' RequestProcessor. Forward or redirect to the specified destination by the specified mechanism. This method catches the Struts' actionForward call. It checks if the actionForward is done on a Tiles definition name. If true, process the definition and insert it. If false, call the original parent's method.

オーバーライド:
クラス RequestProcessor 内の processForwardConfig
パラメータ:
request - The servlet request we are processing.
response - The servlet response we are creating.
forward - The ActionForward controlling where we go next.
例外:
java.io.IOException - if an input/output error occurs.
javax.servlet.ServletException - if a servlet exception occurs.

internalModuleRelativeForward

protected void internalModuleRelativeForward(java.lang.String uri,
                                             javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response)
                                      throws java.io.IOException,
                                             javax.servlet.ServletException
Catch the call to a module relative forward. If the specified uri is a tiles definition name, insert it. Otherwise, parent processing is called. Do a module relative forward to specified uri using request dispatcher. Uri is relative to the current module. The real uri is computed by prefixing the module name. This method is used internally and is not part of the public API. It is advised to not use it in subclasses.

オーバーライド:
クラス RequestProcessor 内の internalModuleRelativeForward
パラメータ:
uri - Module-relative URI to forward to.
request - Current page request.
response - Current page response.
例外:
java.io.IOException
javax.servlet.ServletException
導入されたバージョン:
Struts 1.1

internalModuleRelativeInclude

protected void internalModuleRelativeInclude(java.lang.String uri,
                                             javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response)
                                      throws java.io.IOException,
                                             javax.servlet.ServletException
Do a module relative include to specified uri using request dispatcher. Uri is relative to the current module. The real uri is computed by prefixing the module name. This method is used internally and is not part of the public API. It is advised to not use it in subclasses.

オーバーライド:
クラス RequestProcessor 内の internalModuleRelativeInclude
パラメータ:
uri - Module-relative URI to forward to.
request - Current page request.
response - Current page response.
例外:
java.io.IOException
javax.servlet.ServletException
導入されたバージョン:
Struts 1.1

getDefinitionsFactory

public DefinitionsFactory getDefinitionsFactory()
Get associated definition factory.



このドキュメントは、Ja-Jakartaにより訳されました。コメントがある場合は、report@jajakarta.orgまでお願いします。
Copyright (C) 2000-2004 - Apache Software Foundation