Question

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)

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top