Package org.apache.struts2.interceptor
Interface WithLazyParams<P extends InterceptorParams>
- All Known Implementing Classes:
ActionFileUploadInterceptor
public interface WithLazyParams<P extends InterceptorParams>
Interceptors marked with this interface support dynamic parameter evaluation at action invocation time.
Parameters are set during interceptor creation (factory time), then re-evaluated during each action
invocation to resolve expressions like ${someValue}.
This enables both:
- Static configuration in interceptor stacks (e.g., allowedTypes="image/png,image/jpeg")
- Dynamic expressions evaluated per-request (e.g., maximumSize="${maxUploadSize}")
The Interceptor.init() method is called after initial parameter setting, so interceptors
can rely on configured values during initialization. Expression parameters (containing ${...})
are re-evaluated at invocation time via WithLazyParams.LazyParamInjector and written into a fresh
InterceptorParams holder, never back onto the interceptor, which is shared across
requests and stays untouched after Interceptor.init().
- Since:
- 2.5.9
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionintercept(ActionInvocation invocation, P lazyParams) Invoked in place ofInterceptor.intercept(ActionInvocation)when lazy params apply.
-
Method Details
-
newLazyParams
P newLazyParams()- Returns:
- a fresh holder for one invocation, seeded from the configured values
- Since:
- 7.3.0
-
intercept
Invoked in place ofInterceptor.intercept(ActionInvocation)when lazy params apply.- Parameters:
lazyParams- params resolved for this invocation only- Throws:
Exception- Since:
- 7.3.0
-