This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Scope Interceptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Scope Interceptor" Watch "Scope Interceptor" New topic
Author

Scope Interceptor

Nick Sher
Ranch Hand

Joined: Nov 10, 2008
Posts: 78
Hi,

I am having some difficulty using scope interceptor. I have getter and setter for 'dBean' in my action class and I want to keep it in a session.

I have tried this:


I am using the above action to reset the form but its not working. What am I missing?


Nick
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I guess I'm a little confused; you want to keep something in session, but you're removing it from session after the action executes?
Nick Sher
Ranch Hand

Joined: Nov 10, 2008
Posts: 78
Yes, this is because it is a wizard like form and in between if the user wants to reset the form then I should remove whatever was there in the session. or else save it.
Patrick Kok
Ranch Hand

Joined: Nov 12, 2009
Posts: 42
Nick Sher wrote:Hi,

I am having some difficulty using scope interceptor. I have getter and setter for 'dBean' in my action class and I want to keep it in a session.

I have tried this:


I am using the above action to reset the form but its not working. What am I missing?


Your form is rendered BEFORE your session "dBean" value is invalidate().
your form will never be reset at that way, if I understand you clearly.
Nick Sher
Ranch Hand

Joined: Nov 10, 2008
Posts: 78
Ok, then how do I achieve what I want. I am unable to follow the documentation for this interceptor and could not find examples. Please help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scope Interceptor
 
Similar Threads
Struts 2 file upload tag type allowed error
Problem With Execute and Wait Interceptor
struts 1 plugin issue
Struts 1 Plugin ScopeModenDrivenInterceptor Error
Struts 2 addActionError problem