从struts2-dojo移植到jquery:定期更新jsp中的框架 [英] Porting from struts2-dojo to jquery: periodically update a frame inside a jsp
问题描述
在我的jsp中,我有这个:
In my jsp I have this:
<s:url action="listarichiesteAjax.action" var="richiesteAjax" >
<s:param name="messaggioUtente" value="messaggioUtente"></s:param>
</s:url>
<sx:div href="%{#richiesteAjax}" updateFreq="10000" preload="true">
这段代码每10秒刷新一次(从操作中调用一个JSP)(调用操作listarichiesteAjax来执行查询).我想移植并使用jQuery. 我是否需要更改动作结构?还是我只需要编辑此jsp?
This piece of code refresh every 10sec (calling the action listarichiesteAjax that execute a query) a JSP called from the action. I would like to port this and use jQuery. Do I have to change my actions structure? Or do I just need to edit this jsp?
我将如何修改代码? (我在此处表示,最好使用jQuery而不是Struts2 -jQuery插件)
How do I will modify the code? (I read here that it's preferable use jQuery instead of Struts2-jQuery plugin)
推荐答案
来自 DivTag文档:
updateFreq false false Number
How often to reload the content (in milliseconds). e.g. 5000
所以它在那里并且它也有相同的名字.
So it is there and it also has the same name.
您只需要将<sx:
更改为<sj:
,导入jquery标签:
You only need to change <sx:
to <sj:
, import jquery tags:
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
,然后将<sj:head/>
放在您的<head>
部分中,该位置应该已经有<sx:head/>
and put <sj:head/>
in your <head>
section, where you should already have <sx:head/>
这篇关于从struts2-dojo移植到jquery:定期更新jsp中的框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!