wood burning stoves 2.0*
The moose likes Struts and the fly likes JSP refresh calling action class method automatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSP refresh calling action class method automatically" Watch "JSP refresh calling action class method automatically" New topic
Author

JSP refresh calling action class method automatically

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
Hello all,

I am having a JSP page which will have a hidden button. The JSP is refreshed after every 3 seconds and whenever the JSp is refreshed the hidden button action method (processButtonPressedEvent)in the action class should be called automatically. Is this possible in struts? and if it is possible how to implement it.I mean how do I indicate the button pressed event as in real nobody is going to press that button but the JSP refeshing should call that method automatically.

thanks,
Trupti
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

Trupti,
What does pressing that button do in JSF? Does it call Javascript? If so, you could call the javascript function using the onLoad function.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
Jeanne,

The button click should call the method in the action class.Like the processButtonClickEvent(Written by me).It will not do any javaScript realted stuff.
Every time the JSP is refreshed,in this case after 3 seconds the action class processButtonClick event should be called automatically.This method in turn does some dataBase query to check a particular column value.

How do I implement the above so that whenever the JSp is refreshed the action class method should be invoked automatically.

Thanks,
Trupti
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JSP refresh calling action class method automatically
 
Similar Threads
Visual Web JSF Navigation issue
document.referrer in struts
Help with hidden field
Visual Web JSF Navigation... Help!
Ms Access update field automatically