You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Grzegorz Stasica <gs...@poczta.onet.pl> on 2005/07/14 22:34:21 UTC

ajax and struts-flow - how to refresh part of a page

hi,

I'm checking struts-flow package and one of it's features "Remote RPC 
support (termed Ajax but with JSON instead of XML) for calling flow 
methods from the client". As much as I can see now there is no problem 
to invoke actions from struts-config but as much as I see all page is 
being rendered although I assume only part of should be. Does anybody 
has an experience with updating some part of a page from struts-flow.jar 
package. I'd like at once give up and start using DWR.
My code is as follow:

function main() {

     forwardAndWait("start",
        { "random"  : random,
          "hint"    : hint,
          "guesses" : guesses} );

     forwardAndWait("success1",
        { "random"  : random,
          "hint"    : hint,
          "guesses" : guesses} );
         break;
}

and struts-config
     <action path="/testList"
           name="xForm"
           type="net.sf.struts.flow.FlowAction"
           className="net.sf.struts.flow.FlowMapping">

       <set-property property="function" value="main" />

       <forward name="start" path="/testList1.do?do=start1"/>
       <forward name="success1" path="/testList1.do?do=success1"/>
       <forward name="success" path="/testList1.do?do=success"/>
     </action>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: ajax and struts-flow - how to refresh part of a page

Posted by Don Brown <do...@gmail.com>.
I'm not sure I understand the question, but if you just want the
ability to call Java methods from the client, I'd go with DWR.  Struts
Flow is a bit more experimental looking at rethinking web applications
as continuations-based Javascript-glued apps where the view logic can
be written in the same language on the server and client.

The particular feature you are talking about is the ability to call
server-side Javascript methods from the client side.  At this point, I
wouldn't recommend using Struts Flow right out of the trunk as it is a
work in progress.  DWR, on the other hand, is a tested and proven
project that, again, does sound more like what you are looking for.

Don

On 7/14/05, Grzegorz Stasica <gs...@poczta.onet.pl> wrote:
> hi,
> 
> I'm checking struts-flow package and one of it's features "Remote RPC
> support (termed Ajax but with JSON instead of XML) for calling flow
> methods from the client". As much as I can see now there is no problem
> to invoke actions from struts-config but as much as I see all page is
> being rendered although I assume only part of should be. Does anybody
> has an experience with updating some part of a page from struts-flow.jar
> package. I'd like at once give up and start using DWR.
> My code is as follow:
> 
> function main() {
> 
>      forwardAndWait("start",
>         { "random"  : random,
>           "hint"    : hint,
>           "guesses" : guesses} );
> 
>      forwardAndWait("success1",
>         { "random"  : random,
>           "hint"    : hint,
>           "guesses" : guesses} );
>          break;
> }
> 
> and struts-config
>      <action path="/testList"
>            name="xForm"
>            type="net.sf.struts.flow.FlowAction"
>            className="net.sf.struts.flow.FlowMapping">
> 
>        <set-property property="function" value="main" />
> 
>        <forward name="start" path="/testList1.do?do=start1"/>
>        <forward name="success1" path="/testList1.do?do=success1"/>
>        <forward name="success" path="/testList1.do?do=success"/>
>      </action>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org