*
The moose likes Struts and the fly likes It is possible to exclude interceptor for given action? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "It is possible to exclude interceptor for given action?" Watch "It is possible to exclude interceptor for given action?" New topic
Author

It is possible to exclude interceptor for given action?

Jayaraj Jaganathan
Ranch Hand

Joined: Jun 29, 2009
Posts: 70
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

Joined: Aug 03, 2008
Posts: 9293
    
  17

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??


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Jayaraj Jaganathan
Ranch Hand

Joined: Jun 29, 2009
Posts: 70
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

Joined: Aug 03, 2008
Posts: 9293
    
  17

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

Joined: Jun 29, 2009
Posts: 70
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

Joined: Aug 03, 2008
Posts: 9293
    
  17

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

Joined: Jun 29, 2009
Posts: 70

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

Joined: Aug 03, 2008
Posts: 9293
    
  17

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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: It is possible to exclude interceptor for given action?