File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to halt other action?[Struts 2.1.6] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to halt other action?[Struts 2.1.6]" Watch "How to halt other action?[Struts 2.1.6]" New topic
Author

How to halt other action?[Struts 2.1.6]

Paul Michael Serrano
Ranch Hand

Joined: Nov 22, 2004
Posts: 59
Hi All,

I do have a question regarding on not going to an action if I already invoked an action in my page. My problem is, when I click (first)<s:a> tag to my page that redirects to an action and click another (second)<s:a> that calls different action while the first action is not yet finished processing until forwarding to success, I'm having an error that the first action did was refresh some variables.

Is it possible to halt the my second action until the first action finished until returning to the success page?

-Paul
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

I can think of a number of ways to do this.
1) You can certainly wait in the second action until the first action completes, but this would be a problem if the user clicks the second anchor tag again.
2) You can check in the second action to see if the first action is still running and just return without forwarding.
3) Disable the second anchor so they cannot do the action until the first action is completed.

It seems to me that option 3 would be the best solution.
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

Yes, there are a number of ways you could do this but I think that what you would want to do is disable the anchor tags until the first action completes.
Paul Michael Serrano
Ranch Hand

Joined: Nov 22, 2004
Posts: 59
Hi Richard,

Thanks for the suggestion and ideas.




-Paul
 
Consider Paul's rocket mass heater.
 
subject: How to halt other action?[Struts 2.1.6]