Skip to main content

Schedule - Web Application Edition

Demonstrates using a local scheduler in a web application. For more usage, refer to dawdler-client-plug-schedule.

1. Download and Run​

Download the sample dawdler-tutorial.zip.

After extracting it, go into the schedule-single-web directory.

Run the main method of UserWebApplication.java.

@DawdlerBootApplication
public class UserWebApplication {
public static void main(String[] args) throws Throwable {
DawdlerWebApplication.run(UserWebApplication.class, args);
}
}

1.1 Configuration Files​

For related configuration, refer to dawdler-schedule-core.

1.2 Running as a Jar​

Run

mvn clean package

to get schedule-single-web-0.0.1-jdk25-SNAPSHOT-all.jar

Then run

java -jar schedule-single-web-0.0.1-jdk25-SNAPSHOT-all.jar

1.3 Verification​

After a successful startup, UserController.java prints once every 10 seconds, and UserWebListener.java prints once every 5 seconds.