org.apache.struts.action
クラス RequestProcessor

java.lang.Object
  拡張org.apache.struts.action.RequestProcessor
直系の既知のサブクラス:
TilesRequestProcessor

public class RequestProcessor
extends java.lang.Object

RequestProcessor contains the processing logic that the Struts controller servlet performs as it receives each servlet request from the container. You can customize the request processing behavior by subclassing this class and overriding the method(s) whose behavior you are interested in changing.

導入されたバージョン:
Struts 1.1
バージョン:
$Revision: 1.2 $ $Date: 2003/12/09 13:46:16 $
作成者:
Craig R. McClanahan, Cedric Dumoulin
翻訳者:
校正者:

フィールドの概要
protected  java.util.HashMap actions
          The set of Action instances that have been created and initialized, keyed by the fully qualified Java class name of the Action class.
protected  ModuleConfig appConfig
          推奨されていません。 use moduleConfig instead.
static java.lang.String INCLUDE_PATH_INFO
          The request attribute under which the path information is stored for processing during a RequestDispatcher.include() call.
static java.lang.String INCLUDE_SERVLET_PATH
          The request attribute under which the servlet path information is stored for processing during a RequestDispatcher.include() call.
protected static org.apache.commons.logging.Log log
          Commons Logging instance.
protected  ModuleConfig moduleConfig
          The ModuleConfiguration we are associated with.
protected  ActionServlet servlet
          The controller servlet we are associated with.
 
コンストラクタの概要
RequestProcessor()
           
 
メソッドの概要
 void destroy()
          Clean up in preparation for a shutdown of this application.
protected  void doForward(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Do a forward to specified uri using request dispatcher.
protected  void doInclude(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Do an include of specified uri using request dispatcher.
 int getDebug()
          推奨されていません。 Configure the logging detail level in your underlying logging implementation
protected  MessageResources getInternal()
          Return the MessageResources instance containing our internal message strings.
protected  javax.servlet.ServletContext getServletContext()
          Return the ServletContext for the web application we are running in.
 void init(ActionServlet servlet, ModuleConfig moduleConfig)
          Initialize this request processor instance.
protected  void internalModuleRelativeForward(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Do a module relative forward to specified uri using request dispatcher.
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 log(java.lang.String message)
          Log the specified message to the servlet context log for this web application.
protected  void log(java.lang.String message, java.lang.Throwable exception)
          Log the specified message and exception to the servlet context log for this web application.
 void process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process an HttpServletRequest and create the corresponding HttpServletResponse.
protected  Action processActionCreate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionMapping mapping)
          Return an Action instance that will be used to process the current request, creating a new one if necessary.
protected  ActionForm processActionForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionMapping mapping)
          Retrieve and return the ActionForm bean associated with this mapping, creating and stashing one if necessary.
protected  void processActionForward(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionForward forward)
          推奨されていません。 Use processForwardConfig() instead.
protected  ActionForward processActionPerform(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Action action, ActionForm form, ActionMapping mapping)
          Ask the specified Action instance to handle this request.
protected  void processContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Set the default content type (with optional character encoding) for all responses if requested.
protected  ActionForward processException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Exception exception, ActionForm form, ActionMapping mapping)
          Ask our exception handler to handle the exception.
protected  boolean processForward(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionMapping mapping)
          Process a forward requested by this mapping (if any).
protected  void processForwardConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ForwardConfig forward)
          Forward or redirect to the specified destination, by the specified mechanism.
protected  boolean processInclude(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionMapping mapping)
          Process an include requested by this mapping (if any).
protected  void processLocale(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Automatically select a Locale for the current user, if requested.
protected  ActionMapping processMapping(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String path)
          Select the mapping used to process the selection path for this request.
protected  javax.servlet.http.HttpServletRequest processMultipart(javax.servlet.http.HttpServletRequest request)
          If this is a multipart request, wrap it with a special wrapper.
protected  void processNoCache(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Set the no-cache headers for all responses, if requested.
protected  java.lang.String processPath(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Identify and return the path component (from the request URI) that we will use to select an ActionMapping to dispatch with.
protected  void processPopulate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionForm form, ActionMapping mapping)
          Populate the properties of the specified ActionForm instance from the request parameters included with this request.
protected  boolean processPreprocess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          General-purpose preprocessing hook that can be overridden as required by subclasses.
protected  boolean processRoles(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionMapping mapping)
          If this action is protected by security roles, make sure that the current user possesses at least one of them.
protected  boolean processValidate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionForm form, ActionMapping mapping)
          If this request was not cancelled, and the request's ActionMapping has not disabled validation, call the validate() method of the specified ActionForm, and forward back to the input form if there were any errors.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

INCLUDE_PATH_INFO

public static final java.lang.String INCLUDE_PATH_INFO
The request attribute under which the path information is stored for processing during a RequestDispatcher.include() call.

関連項目:
定数フィールド値

INCLUDE_SERVLET_PATH

public static final java.lang.String INCLUDE_SERVLET_PATH
The request attribute under which the servlet path information is stored for processing during a RequestDispatcher.include() call.

関連項目:
定数フィールド値

actions

protected java.util.HashMap actions
The set of Action instances that have been created and initialized, keyed by the fully qualified Java class name of the Action class.


appConfig

protected ModuleConfig appConfig
推奨されていません。 use moduleConfig instead.

The ModuleConfiguration we are associated with.


moduleConfig

protected ModuleConfig moduleConfig
The ModuleConfiguration we are associated with.


log

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


servlet

protected ActionServlet servlet
The controller servlet we are associated with.

コンストラクタの詳細

RequestProcessor

public RequestProcessor()
メソッドの詳細

destroy

public void destroy()
Clean up in preparation for a shutdown of this application.


init

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

パラメータ:
servlet - The ActionServlet we are associated with
moduleConfig - The ModuleConfig we are associated with.
例外:
javax.servlet.ServletException - If an error occor during initialization

process

public void process(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response)
             throws java.io.IOException,
                    javax.servlet.ServletException

Process an HttpServletRequest and create the corresponding HttpServletResponse.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating
例外:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a processing exception occurs

processActionCreate

protected Action processActionCreate(javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response,
                                     ActionMapping mapping)
                              throws java.io.IOException
Return an Action instance that will be used to process the current request, creating a new one if necessary.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating
mapping - The mapping we are using
例外:
java.io.IOException - if an input/output error occurs

processActionForm

protected ActionForm processActionForm(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response,
                                       ActionMapping mapping)
Retrieve and return the ActionForm bean associated with this mapping, creating and stashing one if necessary. If there is no form bean associated with this mapping, return null.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating
mapping - The mapping we are using

processActionForward

protected void processActionForward(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    ActionForward forward)
                             throws java.io.IOException,
                                    javax.servlet.ServletException
推奨されていません。 Use processForwardConfig() instead.

Forward or redirect to the specified destination, by the specified mechanism. This method takes the old ActionForward object as parameter. User should use processForwardConfig(HttpServletRequest, HttpServletResponse,ForwardConfig) when possible.

パラメータ:
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

processForwardConfig

protected void processForwardConfig(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    ForwardConfig forward)
                             throws java.io.IOException,
                                    javax.servlet.ServletException
Forward or redirect to the specified destination, by the specified mechanism. This method uses a ForwardConfig object instead an ActionForward.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating
forward - The ForwardConfig controlling where we go next
例外:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs

processActionPerform

protected ActionForward processActionPerform(javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response,
                                             Action action,
                                             ActionForm form,
                                             ActionMapping mapping)
                                      throws java.io.IOException,
                                             javax.servlet.ServletException
Ask the specified Action instance to handle this request. Return the ActionForward instance (if any) returned by the called Action for further processing.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating
action - The Action instance to be used
form - The ActionForm instance to pass to this Action
mapping - The ActionMapping instance to pass to this Action
例外:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs

processContent

protected void processContent(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
Set the default content type (with optional character encoding) for all responses if requested. NOTE - This header will be overridden automatically if a RequestDispatcher.forward() call is ultimately invoked.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating

processException

protected ActionForward processException(javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.http.HttpServletResponse response,
                                         java.lang.Exception exception,
                                         ActionForm form,
                                         ActionMapping mapping)
                                  throws java.io.IOException,
                                         javax.servlet.ServletException
Ask our exception handler to handle the exception. Return the ActionForward instance (if any) returned by the called ExceptionHandler.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are processing
exception - The exception being handled
form - The ActionForm we are processing
mapping - The ActionMapping we are using
例外:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs

processForward

protected boolean processForward(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 ActionMapping mapping)
                          throws java.io.IOException,
                                 javax.servlet.ServletException
Process a forward requested by this mapping (if any). Return true if standard processing should continue, or false if we have already handled this request.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating
mapping - The ActionMapping we are using
例外:
java.io.IOException
javax.servlet.ServletException

processInclude

protected boolean processInclude(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 ActionMapping mapping)
                          throws java.io.IOException,
                                 javax.servlet.ServletException
Process an include requested by this mapping (if any). Return true if standard processing should continue, or false if we have already handled this request.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating
mapping - The ActionMapping we are using
例外:
java.io.IOException
javax.servlet.ServletException

processLocale

protected void processLocale(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
Automatically select a Locale for the current user, if requested. NOTE - configuring Locale selection will trigger the creation of a new HttpSession if necessary.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating

processMapping

protected ActionMapping processMapping(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response,
                                       java.lang.String path)
                                throws java.io.IOException
Select the mapping used to process the selection path for this request. If no mapping can be identified, create an error response and return null.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating
path - The portion of the request URI for selecting a mapping
例外:
java.io.IOException - if an input/output error occurs

processMultipart

protected javax.servlet.http.HttpServletRequest processMultipart(javax.servlet.http.HttpServletRequest request)
If this is a multipart request, wrap it with a special wrapper. Otherwise, return the request unchanged.

パラメータ:
request - The HttpServletRequest we are processing

processNoCache

protected void processNoCache(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
Set the no-cache headers for all responses, if requested. NOTE - This header will be overridden automatically if a RequestDispatcher.forward() call is ultimately invoked.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating

processPath

protected java.lang.String processPath(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response)
                                throws java.io.IOException
Identify and return the path component (from the request URI) that we will use to select an ActionMapping to dispatch with. If no such path can be identified, create an error response and return null.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating
例外:
java.io.IOException - if an input/output error occurs

processPopulate

protected void processPopulate(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response,
                               ActionForm form,
                               ActionMapping mapping)
                        throws javax.servlet.ServletException
Populate the properties of the specified ActionForm instance from the request parameters included with this request. In addition, request attribute Globals.CANCEL_KEY will be set if the request was submitted with a button created by CancelTag.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating
form - The ActionForm instance we are populating
mapping - The ActionMapping we are using
例外:
javax.servlet.ServletException - if thrown by RequestUtils.populate()

processPreprocess

protected boolean processPreprocess(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response)
General-purpose preprocessing hook that can be overridden as required by subclasses. Return true if you want standard processing to continue, or false if the response has already been completed. The default implementation does nothing.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating

processRoles

protected boolean processRoles(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response,
                               ActionMapping mapping)
                        throws java.io.IOException,
                               javax.servlet.ServletException
If this action is protected by security roles, make sure that the current user possesses at least one of them. Return true to continue normal processing, or false if an appropriate response has been created and processing should terminate.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating
mapping - The mapping we are using
例外:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs

processValidate

protected boolean processValidate(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response,
                                  ActionForm form,
                                  ActionMapping mapping)
                           throws java.io.IOException,
                                  javax.servlet.ServletException

If this request was not cancelled, and the request's ActionMapping has not disabled validation, call the validate() method of the specified ActionForm, and forward back to the input form if there were any errors. Return true if we should continue processing, or false if we have already forwarded control back to the input form.

パラメータ:
request - The servlet request we are processing
response - The servlet response we are creating
form - The ActionForm instance we are populating
mapping - The ActionMapping we are using
例外:
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
Do a module relative forward to specified uri using request dispatcher. Uri is relative to the current module. The real uri is compute 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.

パラメータ:
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 compute 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.

パラメータ:
uri - Module-relative URI to include
request - Current page request
response - Current page response
例外:
java.io.IOException
javax.servlet.ServletException
導入されたバージョン:
Struts 1.1

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 to specified uri using request dispatcher. This method is used by all internal method needing to do a forward.

パラメータ:
uri - Context-relative URI to forward to
request - Current page request
response - Current page response
例外:
java.io.IOException
javax.servlet.ServletException
導入されたバージョン:
Struts 1.1

doInclude

protected void doInclude(java.lang.String uri,
                         javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)
                  throws java.io.IOException,
                         javax.servlet.ServletException
Do an include of specified uri using request dispatcher. This method is used by all internal method needing to do an include

パラメータ:
uri - Context-relative URI to include
request - Current page request
response - Current page response
例外:
java.io.IOException
javax.servlet.ServletException
導入されたバージョン:
Struts 1.1

getDebug

public int getDebug()
推奨されていません。 Configure the logging detail level in your underlying logging implementation

Return the debugging detail level that has been configured for our controller servlet.


getInternal

protected MessageResources getInternal()
Return the MessageResources instance containing our internal message strings.


getServletContext

protected javax.servlet.ServletContext getServletContext()
Return the ServletContext for the web application we are running in.


log

protected void log(java.lang.String message)
Log the specified message to the servlet context log for this web application.

パラメータ:
message - The message to be logged

log

protected void log(java.lang.String message,
                   java.lang.Throwable exception)
Log the specified message and exception to the servlet context log for this web application.

パラメータ:
message - The message to be logged
exception - The exception to be logged


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