Package org.apache.struts2.interceptor
Class WithLazyParams.LazyParamInjector
java.lang.Object
org.apache.struts2.interceptor.WithLazyParams.LazyParamInjector
- Enclosing interface:
- WithLazyParams<P extends InterceptorParams>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OgnlUtilprotected ReflectionProviderprotected TextParser -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<P extends InterceptorParams>
PresolveInto(P target, Map<String, String> params, ActionContext invocationContext) Resolves configured params into a per-invocation holder, leaving the interceptor untouched.voidsetOgnlUtil(OgnlUtil ognlUtil) voidsetReflectionProvider(ReflectionProvider reflectionProvider) voidsetTextParser(TextParser textParser)
-
Field Details
-
ognlUtil
-
textParser
-
reflectionProvider
-
-
Constructor Details
-
LazyParamInjector
-
-
Method Details
-
setTextParser
-
setReflectionProvider
-
setOgnlUtil
-
resolveInto
public <P extends InterceptorParams> P resolveInto(P target, Map<String, String> params, ActionContext invocationContext) Resolves configured params into a per-invocation holder, leaving the interceptor untouched.Every path that skips a write notifies the holder via
InterceptorParams.unresolved(String), so the holder can fail closed rather than silently validating against a dimension that was dropped. Two such paths exist:- a
${...}expression that resolves to null or an empty value (seeisUnresolved(java.lang.String, java.lang.Object)) - a resolved value the holder's setter cannot accept, e.g. a non-numeric string for a
Longproperty, which OGNL reports as aReflectionExceptionduring conversion
unresolvedis a no-op by default. Whatever the holder was seeded with is left in place, but for a${...}param that is not a usable default: the seed comes from applying the raw configuration string at build time, so it is either the unevaluated${...}literal or, when the literal could not be converted to the property's type, nothing at all.The empty-value rule also catches an expression that legitimately evaluates to an empty string, which is indistinguishable from a failed resolution; for a fail-closed policy such as an allowlist, treating both as unusable is the safe reading, so a broken expression cannot silently relax a validation policy.
- Since:
- 7.3.0
- a
-