views:

24

answers:

2

I'm using JSP & Struts2 for development.

When I login, I call an action, which inturn takes some time to load the data on the page.

While the data is getting loaded, I want to show a busy cursor and once the page is completely loaded, remove off that.

Also I'm using jQuery to a large extent. Is there a way to achieve this?

+1  A: 

Based on your question, it sounds like you might get a better user experience by postponing the long-running action call until after your page has loaded.

To achieve that, have your JSP render a busy indicator of some sort, get the data from your action with an ajax call that runs on the page's onload event, and finally place the content where you'd like it. I'm sure jQuery does all of this for you very easily.

Lauri Lehtinen
hmm, that would require some code change, let me finish the functionality and then work on this, was wondering if there was an easier way!!
Panther24
+1  A: 

I've used plain Struts2 (no jquery) for this scenario with the ExecuteAndWait Interceptor. See my response here.

leonbloy
Actually in my case, the data is loaded, but the population is taking time, so was looking at a way to find to show a busy cursor until the data is populated and page is rendered.
Panther24
@leonbloy: I learnt something new from you post, thanks a lot.
Panther24