Implement the progress bar display with the WebWork

xiaoxiao2021-03-06  67

Webwork has released WebWork2.1.1, which is released quickly, and it is not explained that is being palemarking. The most important new feature in this release is to show, for example: integration with SiteMesh (SiteMesh's decorator can access the Action attributes through the WebWork tag library), etc. Please visit quite visit:

http://wiki.opensymphony.com//display/OOS/2004/08/27/webwork 2.1.1 released

Let's start our topic: In the latest webwork2.1.1, an interceptor has been added: execandwait exec "will request the Action Go to the background, return "Wait" output result; again the same Action request, if the Action is executed, it will return the real output result. Note: "WAIT" Output Waiting When the page must contain the following statement: > it is 5 Second, re-refresh the front Action request.

Example: // WaitAction.java

Package example.wait;

Import com.opensymphony.xwork.action;

Public class waiting imports action {

Public String Execute () throws exception {try {system.out.println ("----- start sleep!"); thread.sleep (2000 * 10); system.out.println ("----- End Sleep! ");} catch (interruptedException e) {E.PrintStackTrace ();

Return Success;

}

Xwork.xml:

/ success.jsp / wait.jsp wait. JSP:

<% @ Taglib URI = "Webwork" prefix = "ww"%> > wait ..............

Source code download:

http://forum.javaeye.com/download.php?id=620

转载请注明原文地址:https://www.9cbs.com/read-85902.html

New Post(0)