Class StrutsPrepareAndExecuteFilter
java.lang.Object
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
- All Implemented Interfaces:
jakarta.servlet.Filter
,StrutsStatics
public class StrutsPrepareAndExecuteFilter
extends Object
implements StrutsStatics, jakarta.servlet.Filter
Handles both the preparation and execution phases of the Struts dispatching process. This filter is better to use
when you don't have another filter that needs access to action context information, such as Sitemesh.
-
Field Summary
FieldsFields inherited from interface org.apache.struts2.StrutsStatics
ACTION_MAPPING, HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_ACTION_TAG_INVOCATION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ExecuteOperations
createExecuteOperations
(Dispatcher dispatcher) Creates a new instance ofExecuteOperations
to be used during initialisingDispatcher
protected InitOperations
Creates a new instance ofInitOperations
to be used during initialisingDispatcher
protected PrepareOperations
createPrepareOperations
(Dispatcher dispatcher) Creates a new instance ofPrepareOperations
to be used during initialisingDispatcher
void
destroy()
void
doFilter
(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain) void
init
(jakarta.servlet.FilterConfig filterConfig) protected void
postInit
(Dispatcher dispatcher, jakarta.servlet.FilterConfig filterConfig) Callback for post initialization
-
Field Details
-
prepare
-
execute
-
-
Constructor Details
-
StrutsPrepareAndExecuteFilter
public StrutsPrepareAndExecuteFilter()
-
-
Method Details
-
init
public void init(jakarta.servlet.FilterConfig filterConfig) throws jakarta.servlet.ServletException - Specified by:
init
in interfacejakarta.servlet.Filter
- Throws:
jakarta.servlet.ServletException
-
createInitOperations
Creates a new instance ofInitOperations
to be used during initialisingDispatcher
- Returns:
- instance of
InitOperations
-
createPrepareOperations
Creates a new instance ofPrepareOperations
to be used during initialisingDispatcher
- Returns:
- instance of
PrepareOperations
-
createExecuteOperations
Creates a new instance ofExecuteOperations
to be used during initialisingDispatcher
- Returns:
- instance of
ExecuteOperations
-
postInit
Callback for post initialization- Parameters:
dispatcher
- the dispatcherfilterConfig
- the filter config
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException - Specified by:
doFilter
in interfacejakarta.servlet.Filter
- Throws:
IOException
jakarta.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroy
in interfacejakarta.servlet.Filter
-