org.apache.struts2.dispatcher.ng
类 PrepareOperations

java.lang.Object
  继承者 org.apache.struts2.dispatcher.ng.PrepareOperations

public class PrepareOperations
extends Object

Contains preparation operations for a request before execution


字段摘要
static String CLEANUP_RECURSION_COUNTER
           
 
构造方法摘要
PrepareOperations(javax.servlet.ServletContext servletContext, Dispatcher dispatcher)
           
 
方法摘要
 void assignDispatcherToThread()
          Assigns the dispatcher to the dispatcher thread local
 void cleanupDispatcher()
          Cleans up the dispatcher instance
 void cleanupRequest(javax.servlet.http.HttpServletRequest request)
          Cleans up a request of thread locals
 com.opensymphony.xwork2.ActionContext createActionContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Creates the action context and initializes the thread local
 ActionMapping findActionMapping(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Finds and optionally creates an ActionMapping.
 ActionMapping findActionMapping(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean forceLookup)
          Finds and optionally creates an ActionMapping.
 boolean isUrlExcluded(javax.servlet.http.HttpServletRequest request, List<Pattern> excludedPatterns)
          Check whether the request matches a list of exclude patterns.
 void setEncodingAndLocale(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Sets the request encoding and locale on the response
 javax.servlet.http.HttpServletRequest wrapRequest(javax.servlet.http.HttpServletRequest oldRequest)
          Wraps the request with the Struts wrapper that handles multipart requests better
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

CLEANUP_RECURSION_COUNTER

public static final String CLEANUP_RECURSION_COUNTER
另请参见:
常量字段值
构造方法详细信息

PrepareOperations

public PrepareOperations(javax.servlet.ServletContext servletContext,
                         Dispatcher dispatcher)
方法详细信息

createActionContext

public com.opensymphony.xwork2.ActionContext createActionContext(javax.servlet.http.HttpServletRequest request,
                                                                 javax.servlet.http.HttpServletResponse response)
Creates the action context and initializes the thread local


cleanupRequest

public void cleanupRequest(javax.servlet.http.HttpServletRequest request)
Cleans up a request of thread locals


assignDispatcherToThread

public void assignDispatcherToThread()
Assigns the dispatcher to the dispatcher thread local


setEncodingAndLocale

public void setEncodingAndLocale(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
Sets the request encoding and locale on the response


wrapRequest

public javax.servlet.http.HttpServletRequest wrapRequest(javax.servlet.http.HttpServletRequest oldRequest)
                                                  throws javax.servlet.ServletException
Wraps the request with the Struts wrapper that handles multipart requests better

返回:
The new request, if there is one
抛出:
javax.servlet.ServletException

findActionMapping

public ActionMapping findActionMapping(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response)
Finds and optionally creates an ActionMapping. It first looks in the current request to see if one has already been found, otherwise, it creates it and stores it in the request. No mapping will be created in the case of static resource requests or unidentifiable requests for other servlets, for example.


findActionMapping

public ActionMapping findActionMapping(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response,
                                       boolean forceLookup)
Finds and optionally creates an ActionMapping. if forceLookup is false, it first looks in the current request to see if one has already been found, otherwise, it creates it and stores it in the request. No mapping will be created in the case of static resource requests or unidentifiable requests for other servlets, for example.

参数:
forceLookup - if true, the action mapping will be looked up from the ActionMapper instance, ignoring if there is one in the request or not

cleanupDispatcher

public void cleanupDispatcher()
Cleans up the dispatcher instance


isUrlExcluded

public boolean isUrlExcluded(javax.servlet.http.HttpServletRequest request,
                             List<Pattern> excludedPatterns)
Check whether the request matches a list of exclude patterns.

参数:
request - The request to check patterns against
excludedPatterns - list of patterns for exclusion
返回:
true if the request URI matches one of the given patterns