• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

It is possible to exclude interceptor for given action?

 
Jayaraj Jaganathan
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible to exclude interceptor for given action?


struts-common.xml


Please let me know how to configure ?



Thanks in advance
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible to exclude interceptor for given action?

Is this a question or a statement ??

What do you want to do basically?? I'm not sure if I understood what you are trying to do with that action of yours. Which interceptors do you want to get invoked and which not??
 
Jayaraj Jaganathan
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is possible to exclude interceptor for given action?

it is a question ?


What do you want to do basically?? I'm not sure if I understood what you are trying to do with that action of yours. Which interceptors do you want to get invoked and which not??


you are right.


for my LoginAction i don't need SessionInterceptor. please help me
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know of two ways to do what you want.

1. Define a new interceptor stack in your action declaration i.e. a list of all interceptors except the session interceptor.

2. Exclude all methods of that action in your session interceptor like follows

If there's a better way of doing this, then I don't know of it...
 
Jayaraj Jaganathan
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankit Garg wrote:I know of two ways to do what you want.

1. Define a new interceptor stack in your action declaration i.e. a list of all interceptors except the session interceptor.

2. Exclude all methods of that action in your session interceptor like follows

If there's a better way of doing this, then I don't know of it...


i like the second option. the above configuration is not working.
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jayaraj Jaganathan wrote:i like the second option. the above configuration is not working.

Which above configuration?? Is this session interceptor your custom interceptor?? I cannot find it in the list of interceptors here or in my book...
 
Jayaraj Jaganathan
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Which above configuration?? Is this session interceptor your custom interceptor?? I cannot find it in the list of interceptors here or in my book...


Yes session interceptor is my custom interceptor.

 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well in that case you'll have to handle the excludeMethods parameter in your interceptor. The easiest way is to extend your interceptor from the MethodFilterInterceptor and implementing the doIntercept method...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic