Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Flow of the Application with Interceptors

 
Ranch Hand
Posts: 189
  • 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 !!!
 
Bartender
Posts: 9615
16
Mac OS X Linux Windows
  • Likes 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
  • 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
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic