I wrote an interceptor for struts2 application and configured in struts configuration file. Here i am using this interceptor for only some actions , not for globally.So here my problem is when validation errors are coming from ActionName-validation.xml at that time my custom interceptor is not working.Please give me suggestion/solution.
Asked
Active
Viewed 68 times
1

Andrea Ligios
- 49,480
- 26
- 114
- 243

Jagadeesh
- 87
- 1
- 13
-
BTW next time consider posting some code, even if the question is clear – Andrea Ligios Nov 23 '15 at 09:09
1 Answers
1
First of all, read how the validation (and conversion) error are handled by Struts2, then move your Interceptor BEFORE the Validation/Parameters/ConversionError Interceptors
The easier way is to define a new stack with your interceptor at first (or in the middle, "exploding" the defaultStack) like follows:
<interceptor-stack name="customStack">
<interceptor-ref name="customInterceptor"/>
<interceptor-ref name="defaultStack"/>
</interceptor-stack>
And then apply customStack
or defaultStack
action by action or package by package, according to your needs.

Community
- 1
- 1

Andrea Ligios
- 49,480
- 26
- 114
- 243
-
Did it work ? If no, just feed back here, if yes, please remember to accept and upvote the answer, thank you – Andrea Ligios Nov 25 '15 at 13:04