File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Flow of the Application with Interceptors

 
Tarun Oohri
Ranch Hand
Posts: 189
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9214
9
Linux Mac OS X Windows
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tarun Oohri
Ranch Hand
Posts: 189
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic