You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by cpanon <cp...@yahoo.com> on 2009/07/18 03:45:18 UTC

Struts w/Ajax with Struts again

Hello 
I am able to use an Ajax call to a struts action and with getInputForward() get the get the data back.  (With prototpye and json, very, very elegant).  I am now realizing that I have cases where I want to reprocess all components, i.e. I want the actionForm to be updated and the jsp recalculated, I want the session objects to be reprocessed so my iterate tags will show the updates, etc.  I understand how with getInputForward it doesnt happen.  If I setAttribute(), the original value that was processed when the form first generated is all that ever shows.  A simple findForward() does not force the reprocessing,ie still the original values of the actionsForm members.  Is there a way to force a complete reprocessing the jsp from within an action?  tia. 

RE: Struts w/Ajax with Struts again

Posted by Martin Gainty <mg...@hotmail.com>.
ajax's responsibility is to return either json or html formatted text to innerHtml attribute of div tag identified in ajax call

 

other activity such as refreshing session attributes would need to take place

in the action class..upon return from action all tags of the jsp would re-display the content based on the refreshed state for those session attributes

 

another strategy is to create and/or modify a jsp in the action and on return forwards to a result *which will forward to the just created or modified jsp* 


you're welcome
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



 

> Date: Fri, 17 Jul 2009 18:45:18 -0700
> From: cpanon@yahoo.com
> Subject: Struts w/Ajax with Struts again
> To: user@struts.apache.org
> 
> Hello 
> I am able to use an Ajax call to a struts action and with getInputForward() get the get the data back.  (With prototpye and json, very, very elegant).  I am now realizing that I have cases where I want to reprocess all components, i.e. I want the actionForm to be updated and the jsp recalculated, I want the session objects to be reprocessed so my iterate tags will show the updates, etc.  I understand how with getInputForward it doesnt happen.  If I setAttribute(), the original value that was processed when the form first generated is all that ever shows.  A simple findForward() does not force the reprocessing,ie still the original values of the actionsForm members.  Is there a way to force a complete reprocessing the jsp from within an action?  tia. 

_________________________________________________________________
Windows Live™ Hotmail®: Search, add, and share the web’s latest sports videos. Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_videos_072009&cat=sports

Re: Struts w/Ajax with Struts again

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
The form will not be updated unless you refresh the values or the part
of the page that displays the values you want to be updated. So you
would have to "manually" do this processing some returned updated
values in a json result, or by returning the result of a "partial" jsp
which re-renders the part of the page that you want to be updated, and
then replace the existing html (using innerHTML).

Nils-H

On Sat, Jul 18, 2009 at 3:45 AM, cpanon<cp...@yahoo.com> wrote:
> Hello
> I am able to use an Ajax call to a struts action and with getInputForward() get the get the data back.  (With prototpye and json, very, very elegant).  I am now realizing that I have cases where I want to reprocess all components, i.e. I want the actionForm to be updated and the jsp recalculated, I want the session objects to be reprocessed so my iterate tags will show the updates, etc.  I understand how with getInputForward it doesnt happen.  If I setAttribute(), the original value that was processed when the form first generated is all that ever shows.  A simple findForward() does not force the reprocessing,ie still the original values of the actionsForm members.  Is there a way to force a complete reprocessing the jsp from within an action?  tia.
>

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