aspose file tools*
The moose likes Struts and the fly likes Flow of the Application with Interceptors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Flow of the Application with Interceptors" Watch "Flow of the Application with Interceptors" New topic
Author

Flow of the Application with Interceptors

Tarun Oohri
Ranch Hand

Joined: Feb 20, 2013
Posts: 176
Hi Everyone,
I am having a doubt in the flow with which the process goes.
Lets say my action in struts.xml is as follows
Lets say this application allows you to enter your name from index.jsp and show it in the result.jsp

So, according to me, the param interceptor (which is inside the default-stack) will set my name in the ValueStack and then the "upper" interceptor will be invoked (which is a custom interceptor), from within this interceptor invoke() is called , which transfer the flow to the Action class (or next interceptor).

Action class returns a String "success". Now after executing the Action class the result string (ie. success) comes to the "upper" interceptor.
The "upper" interceptor will execute the statements given after the invoke() & then the intercept method will finish executing and return a String "success".

Now the flow comes to default-stack & the remaining statements are executed and it returns the String "success".

As, both the interceptors have been executed & the return is a "success".
Now, the flow goes to the <result> tag & the result name is matched and the flow is rendered to the result.jsp.

Am i right ??
Is the following flow right ?

default-interceptor-->upper-->ACTION-->upper-->default-interceptor-->welcome.jsp

Thanks in Advance !!!
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8900
    
    8

Tarun Oohri wrote:
default-interceptor-->upper-->ACTION-->upper-->default-interceptor-->welcome.jsp


The flow actually goes from your action to the JSP, then back up through the interceptor stack in reverse order. See here.
The "default-interceptor" is not a single interceptor, but several: see here.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Tarun Oohri
Ranch Hand

Joined: Feb 20, 2013
Posts: 176
Joe Ess wrote:
Tarun Oohri wrote:
default-interceptor-->upper-->ACTION-->upper-->default-interceptor-->welcome.jsp


The flow actually goes from your action to the JSP, then back up through the interceptor stack in reverse order. See here.
The "default-interceptor" is not a single interceptor, but several: see here.


Thank you Joe ... I understood it now
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Flow of the Application with Interceptors