You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jose Carlos Rubia Raya <jo...@yahoo.es> on 2002/03/21 16:48:00 UTC

Programmed Actions With Struts Applications

I'm developing an application with Struts and I need
that my application every night at 2:00AM executes an
action. That action consists in a query to the DB
and before it executes a serie of intruccions
depending of the data of the DB.
How can I made it?
I have no idea how to made it.

_______________________________________________________________
Do You Yahoo!?
Yahoo! Messenger
Comunicación instantánea gratis con tu gente.
http://messenger.yahoo.es

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Programmed Actions With Struts Applications

Posted by Tim Sawyer <ts...@nildram.co.uk>.
Presuming you've split out your business logic from your presentation layer,
you can write a simple client to your business logic (bypassing all the
struts stuff completely) and then call that simple client at 2am.  Or write
a client that sits there until 2am and then calls your business logic
classes to do the appropriate stuff.

T.

-----Original Message-----
From: Jose Carlos Rubia Raya [mailto:josecrubia@yahoo.es]
Sent: Thursday, March 21, 2002 3:48 PM
To: Struts Users Mailing List
Subject: Programmed Actions With Struts Applications


I'm developing an application with Struts and I need
that my application every night at 2:00AM executes an
action. That action consists in a query to the DB
and before it executes a serie of intruccions
depending of the data of the DB.
How can I made it?
I have no idea how to made it.

_______________________________________________________________
Do You Yahoo!?
Yahoo! Messenger
Comunicación instantánea gratis con tu gente.
http://messenger.yahoo.es

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Programmed Actions With Struts Applications

Posted by Joseph Barefoot <jo...@hereuare.com>.
I'm not sure how (or if) you can do this within the Struts framework, but if
I were going to do it, I would create a simple start-up Servlet (i.e.,
configured to init on server startup in the web.xml file) whose only
function is to instantiate a "Worker" object.  This Worker object creates a
Thread that waits until 2:00 a.m. every day, then makes the DB query and
executes whatever series of instructions you desire.  If you need to store
results from the query, just pass in the ServletContext to the Worker object
in its constructor and you can then store the results as a value object in
the ServletContext for later retrieval by your Action classes, JSPs, etc.

I'm not sure if that would work for you, but it's all I could think of. :)

regards,

Joe Barefoot



-----Original Message-----
From: Jose Carlos Rubia Raya [mailto:josecrubia@yahoo.es]
Sent: Thursday, March 21, 2002 7:48 AM
To: Struts Users Mailing List
Subject: Programmed Actions With Struts Applications


I'm developing an application with Struts and I need
that my application every night at 2:00AM executes an
action. That action consists in a query to the DB
and before it executes a serie of intruccions
depending of the data of the DB.
How can I made it?
I have no idea how to made it.

_______________________________________________________________
Do You Yahoo!?
Yahoo! Messenger
Comunicación instantánea gratis con tu gente.
http://messenger.yahoo.es

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Programmed Actions With Struts Applications

Posted by Roger Fortier <ro...@sympatico.ca>.
You may take a look at the following article in JavaPro for ideas:

Take Java to Task - Building your own Java component to run and schedule
tasks is easy with two new JDK classes

http://www.fawcette.com/javapro/2002_02/magazine/features/eberkovich/



-----Original Message-----
From: Jose Carlos Rubia Raya [mailto:josecrubia@yahoo.es] 
Sent: Thursday, March 21, 2002 10:48 AM
To: Struts Users Mailing List
Subject: Programmed Actions With Struts Applications

I'm developing an application with Struts and I need
that my application every night at 2:00AM executes an
action. That action consists in a query to the DB
and before it executes a serie of intruccions
depending of the data of the DB.
How can I made it?
I have no idea how to made it.

_______________________________________________________________
Do You Yahoo!?
Yahoo! Messenger
Comunicación instantánea gratis con tu gente.
http://messenger.yahoo.es

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>