1

I am using Tomcat with the Spring framework. I want to have a class called by the server every 30 minutes. Is there a good way to do this in Servlet, Spring, or Struts?

3

2 Answers 2

3

Try this:

http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/scheduling.html

Sign up to request clarification or add additional context in comments.

Comments

-2

You could create a new Thread on container startup that sleeps for 30 minutes and then performs your action. See here for information about context listeners.

1 Comment

A sleeping Thread is an extremely bad idea on a lifelong running Java EE container.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.