简体   繁体   English

如何从计时器调用struts1动作?

[英]How to invoke struts1 action from a timer?

I got a struts1 web application, mainly forms submitted to the struts Actions on the server side. 我有一个struts1 Web应用程序,主要是将表单提交给服务器端的struts Actions。 I would need to add a timer, that once in a while will read the parameters for the same form but from other source (like DB or file). 我需要添加一个计时器,该计时器偶尔会从其他来源(例如DB或文件)读取相同形式的参数。 So, basically the form will be filled in the timer, instead of the page. 因此,基本上将在计时器中而不是页面中填写表格。 the questions is: how do I invoke the same Action for the Form? 问题是:如何为表单调用相同的动作? but from the timer thread, and not through the web page. 但通过计时器线程而不是通过网页进行。

You can use javascript timer objects to create these time based events as described here . 您可以使用JavaScript计时器对象描述来创建这些基于时间的事件在这里 And then use normal ajax/event based form submission for example . 然后用正常的AJAX /基于事件的表单提交的例子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM