Porting from struts2-dojo to jquery: periodically update a frame inside a jsp

僤鯓⒐⒋嵵緔 提交于 2019-12-11 11:35:28

问题


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">

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?

How do I will modify the code? (I read here that it's preferable use jQuery instead of Struts2-jQuery plugin)


回答1:


From the DivTag documentation:

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.

You only need to change <sx: to <sj: , import jquery tags:

<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>

and put <sj:head/> in your <head> section, where you should already have <sx:head/>



来源:https://stackoverflow.com/questions/23652323/porting-from-struts2-dojo-to-jquery-periodically-update-a-frame-inside-a-jsp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!