deepika mane

Greenhorn
+ Follow
since Jul 15, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by deepika mane

Hi,

I have developed a web application using struts 2 framework . I want to generate a password automatically on first time log in to the application and send a notification mail with new password and a link to change that password. How to detect the first time log in of the user?
13 years ago
Hi,
Thanks for your reply. I tried it using quartz scheduler but i was not able to call an action class through quartz also.
My basic problem my job contains some database activities and i am using hibernate to handle database activities .
Struts2 sets hibernate environment before invoking action class by itself.
Can you tell me how to call a struts action class using quartz?
Or any other way to schedule my task which uses hibernate?
14 years ago
Hi thanks for reply.But can you please elaborate on how can i call action class using ScheduledThreadPoolExecutor.
14 years ago
Hi,
I want to schedule a task which will be executed say every day or weekly.I have used struts2 action class in which i am doing all required tasks which include some database activities. I am using hibernate for database actions.
I am using Timer and TimerTask to schedule this task. But i am not able to call the action class from run method of the TimerTask.Does anyone have any idea regarding how to do this?

For example

/*Action class that will start the schedular*/
StartSchedular.java
public class Scheduler extends ActionSupport implements SessionAware
{

@Override
public String execute() throws Exception
{

TimerTask task = new foo(ac,request,response);
Calendar date = Calendar.getInstance();
Timer timer = new Timer();
timer.schedule(task ,5*1000,24*60*60*1000 );

return SUCCESS;
}
}


/*Scheduler class which will schedule the above action class to execute at specified time*/
class schedular extends TimerTask
{
public void run()
{
}
}


/*Scheduler class which will schedule the above action class to execute at specified time*/
class schedular extends TimerTask
{
public void run()
{
}
}

/*Action class that will be executed at scheduled time*/
foo.java

class foo extends ActionSupport implements sessionAware
{
/*
Logic goes here
*/

}



I want to call foo.java from run method. Can anyone help me please.
Reply With Quote
14 years ago