This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to halt other action?[Struts 2.1.6]

 
Paul Michael Serrano
Ranch Hand
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 213
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 213
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Richard,

Thanks for the suggestion and ideas.




-Paul
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic