• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Flow of the Application with Interceptors

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9626
16
Mac OS X Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 do some of my very best work in water. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic