RE: Struts w/Ajax with Struts again

2009-07-23 Thread Martin Gainty

please display 
all jsp
all xml (web.xml,struts.xml,struts-default.xml..and struts-config.xml if 
applicable)
all source for background Java classes (including all Actions and all 
referenced beans)
which version struts you are using? 
which version dojo you are using?
(your main dojo.js should contain the line: 
dojo.version={major:0,minor:4,patch:3..} version=0.43)

Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung
 
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.






> Date: Thu, 23 Jul 2009 09:39:51 -0400
> From: newton.d...@yahoo.com
> To: user@struts.apache.org
> Subject: Re: Struts w/Ajax with Struts again
> 
> cpanon wrote:
> > What I was able to reproduce was that if I enter the action with an
> > Ajax call, using prototype, and return with
> > mapping.getInputForward(), the session objects do not get updated;
> > even though I update them in the action.  If, however I enter the
> > action with a click off a html:submit button the session objects do
> > get updated and I see the current values on the form.  I never
> > expected that.  Should processing through an action and the updating
> > of the session objects, be the same however the action was called?
> 
> Why would the form on the main page be updated by the results of an Ajax 
> call if the Ajax call processing doesn't do anything with the form?
> 
> Ajax calls happen in the background. *Nothing* on the calling page will 
> be updated unless the Ajax return handler updates it.
> 
> Dave
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
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

2009-07-23 Thread Dave Newton

cpanon wrote:

What I was able to reproduce was that if I enter the action with an
Ajax call, using prototype, and return with
mapping.getInputForward(), the session objects do not get updated;
even though I update them in the action.  If, however I enter the
action with a click off a html:submit button the session objects do
get updated and I see the current values on the form.  I never
expected that.  Should processing through an action and the updating
of the session objects, be the same however the action was called?


Why would the form on the main page be updated by the results of an Ajax 
call if the Ajax call processing doesn't do anything with the form?


Ajax calls happen in the background. *Nothing* on the calling page will 
be updated unless the Ajax return handler updates it.


Dave

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



RE: Struts w/Ajax with Struts again

2009-07-23 Thread cpanon
Hi Martin
I dont want to fillup the post with clutter.  The action elements of the file 
are normal.  

What I was able to reproduce was that if I enter the action with an Ajax call, 
using prototype, and return with mapping.getInputForward(), the session objects 
do not get updated; even though I update them in the action.  If, however I 
enter the action with a click off a html:submit button the session objects do 
get updated and I see the current values on the form.  I never expected that.  
Should processing through an action and the updating of the session objects, be 
the same however the action was called?  

--- On Tue, 7/21/09, Martin Gainty  wrote:

From: Martin Gainty 
Subject: RE: Struts w/Ajax with Struts again
To: "Struts Users Mailing List" 
Date: Tuesday, July 21, 2009, 3:08 PM



post the complete contents of struts-config.xml
event timing is crucial specifically you'll need your Ajax control to detect 
ON_COMPLETE
a fairly comprehensive example of handling ON_COMPLETE at 
http://struts.apache.org/2.0.14/docs/ajax-validation.html


any objections to using new version struts-2.1.6..its stable enough for G/A?
Martin Gainty 
__ 
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: Tue, 21 Jul 2009 10:09:43 -0700
> From: cpa...@yahoo.com
> Subject: RE: Struts w/Ajax with Struts again
> To: user@struts.apache.org
> 
> Hi Martin
> Yes, I did in the line defining both the initial action to bring up the form 
> and the action tasked with processing the Ajax call.  Also I put in the Ajax 
> processing action specific setSeeMe("fromAjaxAction") and set that in both 
> the request and the session objects.  Still nothing but what the first 
> default process set.  The changes set in the Ajax action did not show no 
> matter what life-cycle object they were put in nor what scope the action was 
> defined.  This should not be the case, correct?  If I set the scope to 
> request, and if I set a change in a actionForm and set it in the request, I 
> should see it on the forwarded form.  tia.
> 
> --- On Mon, 7/20/09, Martin Gainty  wrote:
> 
> From: Martin Gainty 
> Subject: RE: Struts w/Ajax with Struts again
> To: "Struts Users Mailing List" 
> Date: Monday, July 20, 2009, 10:18 AM
> 
> 
> did you check scope="request" in struts-config.xml 
> 
> as earlier suggested
> 
> Martin Gainty 
> __ 
> 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: Mon, 20 Jul 2009 03:36:36 -0700
> > From: cpa...@yahoo.com
> > Subject: Re: Struts w/Ajax with Struts again
> > To: user@struts.apache.org
> > 
> > Hi PW
> > But I cant access the session objects with JS, nor can I iterate the 
> > collections I have in th

Re: Struts w/Ajax with Struts again

2009-07-21 Thread Dave Newton

Martin Gainty wrote:


post the complete contents of struts-config.xml
event timing is crucial specifically you'll need your Ajax control to detect 
ON_COMPLETE
a fairly comprehensive example of handling ON_COMPLETE at 
http://struts.apache.org/2.0.14/docs/ajax-validation.html


any objections to using new version struts-2.1.6..its stable enough for G/A?


Still Struts 1.

Dave

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



RE: Struts w/Ajax with Struts again

2009-07-21 Thread Martin Gainty


post the complete contents of struts-config.xml
event timing is crucial specifically you'll need your Ajax control to detect 
ON_COMPLETE
a fairly comprehensive example of handling ON_COMPLETE at 
http://struts.apache.org/2.0.14/docs/ajax-validation.html

any objections to using new version struts-2.1.6..its stable enough for G/A?
Martin Gainty 
__ 
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: Tue, 21 Jul 2009 10:09:43 -0700
> From: cpa...@yahoo.com
> Subject: RE: Struts w/Ajax with Struts again
> To: user@struts.apache.org
> 
> Hi Martin
> Yes, I did in the line defining both the initial action to bring up the form 
> and the action tasked with processing the Ajax call.  Also I put in the Ajax 
> processing action specific setSeeMe("fromAjaxAction") and set that in both 
> the request and the session objects.  Still nothing but what the first 
> default process set.  The changes set in the Ajax action did not show no 
> matter what life-cycle object they were put in nor what scope the action was 
> defined.  This should not be the case, correct?  If I set the scope to 
> request, and if I set a change in a actionForm and set it in the request, I 
> should see it on the forwarded form.  tia.
> 
> --- On Mon, 7/20/09, Martin Gainty  wrote:
> 
> From: Martin Gainty 
> Subject: RE: Struts w/Ajax with Struts again
> To: "Struts Users Mailing List" 
> Date: Monday, July 20, 2009, 10:18 AM
> 
> 
> did you check scope="request" in struts-config.xml 
> 
> as earlier suggested
> 
> Martin Gainty 
> __ 
> 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: Mon, 20 Jul 2009 03:36:36 -0700
> > From: cpa...@yahoo.com
> > Subject: Re: Struts w/Ajax with Struts again
> > To: user@struts.apache.org
> > 
> > Hi PW
> > But I cant access the session objects with JS, nor can I iterate the 
> > collections I have in the session to display the updated values that were 
> > written in the Ajax processing action.  Correct?
> > 
> > --- On Mon, 7/20/09, Paweł Wielgus  wrote:
> > 
> > From: Paweł Wielgus 
> > Subject: Re: Struts w/Ajax with Struts again
> > To: "Struts Users Mailing List" 
> > Date: Monday, July 20, 2009, 2:18 AM
> > 
> > Hi cpanon,
> > 
> > > I am looking for the simplest technique that would reprocess the session 
> > > objects from the new values, regenerate the full jsp,
> > 
> > then just refresh the whole page, by javascript after completion of ajax.
> > Or do not use ajax at all, this will be most simple solution for You.
> > 
> > Best greetings,
> > Paweł Wielgus.
> 

RE: Struts w/Ajax with Struts again

2009-07-21 Thread cpanon
Hi Martin
Yes, I did in the line defining both the initial action to bring up the form 
and the action tasked with processing the Ajax call.  Also I put in the Ajax 
processing action specific setSeeMe("fromAjaxAction") and set that in both the 
request and the session objects.  Still nothing but what the first default 
process set.  The changes set in the Ajax action did not show no matter what 
life-cycle object they were put in nor what scope the action was defined.  This 
should not be the case, correct?  If I set the scope to request, and if I set a 
change in a actionForm and set it in the request, I should see it on the 
forwarded form.  tia.

--- On Mon, 7/20/09, Martin Gainty  wrote:

From: Martin Gainty 
Subject: RE: Struts w/Ajax with Struts again
To: "Struts Users Mailing List" 
Date: Monday, July 20, 2009, 10:18 AM


did you check scope="request" in struts-config.xml 

as earlier suggested

Martin Gainty 
__ 
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: Mon, 20 Jul 2009 03:36:36 -0700
> From: cpa...@yahoo.com
> Subject: Re: Struts w/Ajax with Struts again
> To: user@struts.apache.org
> 
> Hi PW
> But I cant access the session objects with JS, nor can I iterate the 
> collections I have in the session to display the updated values that were 
> written in the Ajax processing action.  Correct?
> 
> --- On Mon, 7/20/09, Paweł Wielgus  wrote:
> 
> From: Paweł Wielgus 
> Subject: Re: Struts w/Ajax with Struts again
> To: "Struts Users Mailing List" 
> Date: Monday, July 20, 2009, 2:18 AM
> 
> Hi cpanon,
> 
> > I am looking for the simplest technique that would reprocess the session 
> > objects from the new values, regenerate the full jsp,
> 
> then just refresh the whole page, by javascript after completion of ajax.
> Or do not use ajax at all, this will be most simple solution for You.
> 
> Best greetings,
> Paweł Wielgus.
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. 
Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports

RE: Struts w/Ajax with Struts again

2009-07-20 Thread Martin Gainty

did you check scope="request" in struts-config.xml 

as earlier suggested

Martin Gainty 
__ 
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: Mon, 20 Jul 2009 03:36:36 -0700
> From: cpa...@yahoo.com
> Subject: Re: Struts w/Ajax with Struts again
> To: user@struts.apache.org
> 
> Hi PW
> But I cant access the session objects with JS, nor can I iterate the 
> collections I have in the session to display the updated values that were 
> written in the Ajax processing action.  Correct?
> 
> --- On Mon, 7/20/09, Paweł Wielgus  wrote:
> 
> From: Paweł Wielgus 
> Subject: Re: Struts w/Ajax with Struts again
> To: "Struts Users Mailing List" 
> Date: Monday, July 20, 2009, 2:18 AM
> 
> Hi cpanon,
> 
> > I am looking for the simplest technique that would reprocess the session 
> > objects from the new values, regenerate the full jsp,
> 
> then just refresh the whole page, by javascript after completion of ajax.
> Or do not use ajax at all, this will be most simple solution for You.
> 
> Best greetings,
> Paweł Wielgus.
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. 
Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports

Re: Struts w/Ajax with Struts again

2009-07-20 Thread Paweł Wielgus
Hi cpanon,
what i meant is to do real refresh of the page,
just like the one when You hit F5 button or click "Refresh" on your browser.
Try this:
1. load the page
2. do some of that ajax stuff
3. hit F5
is the result like You have expected?

After all not using ajax at all may be best solution in your case.

Best greetings,
Paweł Wielgus.

2009/7/20 cpanon :
> Hi PW
> But I cant access the session objects with JS, nor can I iterate the 
> collections I have in the session to display the updated values that were 
> written in the Ajax processing action.  Correct?
>
> --- On Mon, 7/20/09, Paweł Wielgus  wrote:
>
> From: Paweł Wielgus 
> Subject: Re: Struts w/Ajax with Struts again
> To: "Struts Users Mailing List" 
> Date: Monday, July 20, 2009, 2:18 AM
>
> Hi cpanon,
>
>> I am looking for the simplest technique that would reprocess the session 
>> objects from the new values, regenerate the full jsp,
>
> then just refresh the whole page, by javascript after completion of ajax.
> Or do not use ajax at all, this will be most simple solution for You.
>
> Best greetings,
> Paweł Wielgus.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Struts w/Ajax with Struts again

2009-07-20 Thread cpanon
Hi PW
But I cant access the session objects with JS, nor can I iterate the 
collections I have in the session to display the updated values that were 
written in the Ajax processing action.  Correct?

--- On Mon, 7/20/09, Paweł Wielgus  wrote:

From: Paweł Wielgus 
Subject: Re: Struts w/Ajax with Struts again
To: "Struts Users Mailing List" 
Date: Monday, July 20, 2009, 2:18 AM

Hi cpanon,

> I am looking for the simplest technique that would reprocess the session 
> objects from the new values, regenerate the full jsp,

then just refresh the whole page, by javascript after completion of ajax.
Or do not use ajax at all, this will be most simple solution for You.

Best greetings,
Paweł Wielgus.

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



Re: Struts w/Ajax with Struts again

2009-07-19 Thread Paweł Wielgus
Hi cpanon,

> I am looking for the simplest technique that would reprocess the session 
> objects from the new values, regenerate the full jsp,

then just refresh the whole page, by javascript after completion of ajax.
Or do not use ajax at all, this will be most simple solution for You.

Best greetings,
Paweł Wielgus.

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



Re: Struts w/Ajax with Struts again

2009-07-19 Thread cpanon
Hi Nils & Martin
Thanks and I am sorry about being obtuse and I hope you will continue to make 
this an edifying moment for me.  

When I initially put up the form I code a value in the actionForm, myFormBean 
as myFormBean.setSeeMe("firstTime") and put into the session with 
session.setAttribute("fb00", myFormBean)  I display this value on the form page 
within a html:text with ...value="${sessionScope.fb00.seeMe}, and it shows 
"firstTime" on the form.  Good.  I process the Ajax call in another Action, fed 
with the same class of actionForm.  No matter whether I remove the action form 
session.removeAttirbute("fb00") or if I set it a different value, 
myFormBean2.setSeeMe("fromAjax");session.setAttribute("fb00",myFormBean2).  I 
still see "firstTime".  

I am looking for the simplest technique that would reprocess the session 
objects from the new values, regenerate the full jsp, ancilliary to the json 
object I am setting, in the action processing the Ajax.  Specifically I am 
using the iterate tags to display a series of records and that is what I want 
to be reprocessed and redrawn to the user with the new values that will be in 
the session object set in the Ajax processing action.  

I understand that actions should/must be thread-safe, I just want to reprocess 
objects that are unique to state maintained by the session object.  I am 
suspecting this is not possible.

--- On Sun, 7/19/09, Nils-Helge Garli Hegvik  wrote:

From: Nils-Helge Garli Hegvik 
Subject: Re: Struts w/Ajax with Struts again
To: "Struts Users Mailing List" 
Date: Sunday, July 19, 2009, 9:56 AM

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 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-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Struts w/Ajax with Struts again

2009-07-19 Thread Martin Gainty

apologies as i thought you were uptodate on the latest version

i assume you are implementing 

public ActionForward execute(ActionMapping mapping,
ActionForm form,
ServletRequest request,
ServletResponse response)
throws Exception;

 

the ActionMapping mapping will call findForward which will

Return an appropriate ActionForward object that identifies the presentation 
page to be used to generate this response, based on the newly updated beans. 
Typically, you will acquire a reference to such an object by calling 
findForward on either the ActionMapping object you received (if you are using a 
logical name local to this mapping), or on the controller servlet itself (if 
you are using a logical name global to the application).

 

its important to declare local variables in Action specifically:
controller servlet creates only one instance of your Action class, and uses 
this one instance to service all requests. Thus, you need to write thread-safe 
Action classes. Follow the same guidelines you would use to write thread-safe 
Servlets.  


Only Use Local Variables - The most important principle that aids in 
thread-safe coding is to use only local variables, not instance variables , in 
your Action class. Local variables are created on a stack that is assigned (by 
your JVM) to each request thread, so there is no need to worry about sharing 
them. An Action can be factored into several local methods, so long as all 
variables needed are passed as method parameters. This assures thread safety, 
as the JVM handles such variables internally using the call stack which is 
associated with a single Thread. 
 

For each request made of the controller, the method process(HttpServletRequest, 
HttpServletResponse) will be called.

so keep the guts of the request processing in the Action process method

 

http://struts.apache.org/1.x/userGuide/building_controller.html

 

ActionMapping considerations:

use RequestActionMapping instead of SessionActionMapping
http://struts.apache.org/1.x/apidocs/org/apache/struts/action/RequestActionMapping.html

 

hth
Martin Gainty 
__ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und 
Vertraulichkeitanmerkung/Note de déni et de confidentialité


 
Ez az üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy 
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése 
nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi 
alkalmazhatósága sincs.  Mivel az electronikus üzenetek könnyen 
megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet 
tartalma miatt.

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: Sun, 19 Jul 2009 05:34:00 -0700
> From: cpa...@yahoo.com
> Subject: RE: Struts w/Ajax with Struts again
> To: user@struts.apache.org
> 
> Hi Martin
> Thanks, however I havnt migrate to Struts2 yet.  What I was hoping for was a 
> technique to get all the session objects reprocessed upon return from the 
> Ajax call.  I am unclear that if I do the mapping.getInputForward(), does 
> that force tomcat to reprocess and the jsp reprocess all the session objects? 
>  I have also tried returning from the Ajax call with a forward to the page 
> and that doesnt force a redisplay of updated values.  That should, correct, 
> it is no different than any other usage and with the json result being stored 
> in the header it will not matter for that processing.  
> 
> --- On Sat, 7/18/09, Martin Gainty  wrote:
> 
> From: Martin Gainty 
> Subject: RE: Struts w/Ajax with Struts again
> To: "Struts Users Mailing List" 
> Date: Saturday, July 18, 2009, 11:37 PM
> 
> 
> better off setting it in the action
> 
> then access it thru ognl e.g.
> #session.setSeeMe
> 
> http://struts.apache.org/2.0.14/docs/ognl-basics.html
> 
> 
> 
> if you want to see a bean described as
> 
> package package;

Re: Struts w/Ajax with Struts again

2009-07-19 Thread Nils-Helge Garli Hegvik
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 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-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Struts w/Ajax with Struts again

2009-07-19 Thread cpanon
Hi Martin
Thanks, however I havnt migrate to Struts2 yet.  What I was hoping for was a 
technique to get all the session objects reprocessed upon return from the Ajax 
call.  I am unclear that if I do the mapping.getInputForward(), does that force 
tomcat to reprocess and the jsp reprocess all the session objects?  I have also 
tried returning from the Ajax call with a forward to the page and that doesnt 
force a redisplay of updated values.  That should, correct, it is no different 
than any other usage and with the json result being stored in the header it 
will not matter for that processing.  

--- On Sat, 7/18/09, Martin Gainty  wrote:

From: Martin Gainty 
Subject: RE: Struts w/Ajax with Struts again
To: "Struts Users Mailing List" 
Date: Saturday, July 18, 2009, 11:37 PM


better off setting it in the action

then access it thru ognl e.g.
#session.setSeeMe

http://struts.apache.org/2.0.14/docs/ognl-basics.html

 

if you want to see a bean described as

package package;
public class bean {
  
  private String BeanParamName;

  public void setBeanParamName(String BeanParamName){
    this.BeanParamName =BeanParamName ;
  }
  public String getBeanParamName(){
    return BeanParamName;
  }
} 

 in your jsp use s:bean as here

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



 

  
        BeanParam 
          
      





http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/components/Bean.html


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: Sat, 18 Jul 2009 19:07:26 -0700
> From: cpa...@yahoo.com
> Subject: RE: Struts w/Ajax with Struts again
> To: user@struts.apache.org
> 
> Hi Martin
> Thank you.  So I may be misunderstanding something.  If I return to the Ajax 
> call with mapping.getInputForward() for the defined input attribute of that 
> action processing the Ajax call, should I see changes in the session objects 
> displayed?  Because before I return I set an element in the 
> actionForm.setSeeMe("hi"), set the session.setAttribute("actionForm", 
> modified) and I do not see it in the display.  I am accessing that element 
> with the ${seeMe} syntax.  I am seeing the json results, but not what I put 
> in the actionForm.  That is what I would "organically" expect to see.  Can 
> you clarify this?  tia.
> 
> --- On Sat, 7/18/09, Martin Gainty  wrote:
> 
> From: Martin Gainty 
> Subject: RE: Struts w/Ajax with Struts again
> To: "Struts Users Mailing List" 
> Date: Saturday, July 18, 2009, 9:32 PM
> 
> 
> 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&#

RE: Struts w/Ajax with Struts again

2009-07-18 Thread Martin Gainty

better off setting it in the action

then access it thru ognl e.g.
#session.setSeeMe

http://struts.apache.org/2.0.14/docs/ognl-basics.html

 

if you want to see a bean described as

package package;
public class bean {
  
  private String BeanParamName;

  public void setBeanParamName(String BeanParamName){
this.BeanParamName =BeanParamName ;
  }
  public String getBeanParamName(){
return BeanParamName;
  }
} 

 in your jsp use s:bean as here

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



 

  
BeanParam 
  
  





http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/components/Bean.html


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: Sat, 18 Jul 2009 19:07:26 -0700
> From: cpa...@yahoo.com
> Subject: RE: Struts w/Ajax with Struts again
> To: user@struts.apache.org
> 
> Hi Martin
> Thank you.  So I may be misunderstanding something.  If I return to the Ajax 
> call with mapping.getInputForward() for the defined input attribute of that 
> action processing the Ajax call, should I see changes in the session objects 
> displayed?  Because before I return I set an element in the 
> actionForm.setSeeMe("hi"), set the session.setAttribute("actionForm", 
> modified) and I do not see it in the display.  I am accessing that element 
> with the ${seeMe} syntax.  I am seeing the json results, but not what I put 
> in the actionForm.  That is what I would "organically" expect to see.  Can 
> you clarify this?  tia.
> 
> --- On Sat, 7/18/09, Martin Gainty  wrote:
> 
> From: Martin Gainty 
> Subject: RE: Struts w/Ajax with Struts again
> To: "Struts Users Mailing List" 
> Date: Saturday, July 18, 2009, 9:32 PM
> 
> 
> 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: cpa...@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 getInp

RE: Struts w/Ajax with Struts again

2009-07-18 Thread cpanon
Hi Martin
Thank you.  So I may be misunderstanding something.  If I return to the Ajax 
call with mapping.getInputForward() for the defined input attribute of that 
action processing the Ajax call, should I see changes in the session objects 
displayed?  Because before I return I set an element in the 
actionForm.setSeeMe("hi"), set the session.setAttribute("actionForm", modified) 
and I do not see it in the display.  I am accessing that element with the 
${seeMe} syntax.  I am seeing the json results, but not what I put in the 
actionForm.  That is what I would "organically" expect to see.  Can you clarify 
this?  tia.

--- On Sat, 7/18/09, Martin Gainty  wrote:

From: Martin Gainty 
Subject: RE: Struts w/Ajax with Struts again
To: "Struts Users Mailing List" 
Date: Saturday, July 18, 2009, 9:32 PM


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: cpa...@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

2009-07-18 Thread Martin Gainty

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: cpa...@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

Struts w/Ajax with Struts again

2009-07-17 Thread cpanon
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: Good App for Ajax with struts

2007-03-01 Thread Musachy Barroso

Take a look at the Ajax section on showcase. It has several examples,
although nothing like the mailreader. This might also help:

http://struts.apache.org/2.x/docs/ajax-tags.html

regards
musachy

On 3/1/07, Siva Gurusamy <[EMAIL PROTECTED]> wrote:


Has any body came across good application (ajax with struts) just similar
to
mailreader or showcase which will be useful for learning.



Or any tutorial links which will be useful for learning Struts 2 and Ajax
with Struts2 .



Thanks

siva





--
"Hey you! Would you help me to carry the stone?" Pink Floyd


Re: Ajax with struts

2006-07-24 Thread Frank W. Zammetti
That page isn't actually about AjaxTags, it's about Ajax with Struts in 
general.  It does of course mention AjaxTags :)


In any case, all changed... I also did some updating of that page while 
I was at it :)


Frank

Michael Jouravlev wrote:

No one owns wiki :) I just wanted to structure it so most valuable and
stuff could be included into the next version of the User's Guide. On
another hand, since AjaxTags are not part of Struts (yet?), then maybe
you are right and the better place for this page is in Articles and
How-Tos.

Please, feel free to make appropriate changes. I am doing the same ;-)

On 7/24/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:

See this Wiki entry for a start:

http://wiki.apache.org/struts/AjaxStruts

Frank

P.S. - Michael J. - I think this page is more appropriate in the "Struts
Articles, Tutorials, FAQ's and Tips" section, don't you?  You've become
pretty much the God of the Wiki though, so I didn't want to go move it
on you myself :)

Rauf Khan wrote:
> Hi All,
>
>I wanted to integrate Ajax with struts. Pls let me the link/tutorial
> from where i could get the information.
>
>   Thanks in Advance.
>
> Regards
> Rauf Khan
>

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Ajax with struts

2006-07-24 Thread Michael Jouravlev

No one owns wiki :) I just wanted to structure it so most valuable and
stuff could be included into the next version of the User's Guide. On
another hand, since AjaxTags are not part of Struts (yet?), then maybe
you are right and the better place for this page is in Articles and
How-Tos.

Please, feel free to make appropriate changes. I am doing the same ;-)

On 7/24/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:

See this Wiki entry for a start:

http://wiki.apache.org/struts/AjaxStruts

Frank

P.S. - Michael J. - I think this page is more appropriate in the "Struts
Articles, Tutorials, FAQ's and Tips" section, don't you?  You've become
pretty much the God of the Wiki though, so I didn't want to go move it
on you myself :)

Rauf Khan wrote:
> Hi All,
>
>I wanted to integrate Ajax with struts. Pls let me the link/tutorial
> from where i could get the information.
>
>   Thanks in Advance.
>
> Regards
> Rauf Khan
>

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Ajax with struts

2006-07-24 Thread Frank W. Zammetti

See this Wiki entry for a start:

http://wiki.apache.org/struts/AjaxStruts

Frank

P.S. - Michael J. - I think this page is more appropriate in the "Struts 
Articles, Tutorials, FAQ's and Tips" section, don't you?  You've become 
pretty much the God of the Wiki though, so I didn't want to go move it 
on you myself :)


Rauf Khan wrote:

Hi All,

   I wanted to integrate Ajax with struts. Pls let me the link/tutorial
from where i could get the information.

  Thanks in Advance.

Regards
Rauf Khan



--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Ajax with struts

2006-07-24 Thread Rauf Khan

Hi All,

   I wanted to integrate Ajax with struts. Pls let me the link/tutorial
from where i could get the information.

  Thanks in Advance.

Regards
Rauf Khan


Re: {Maybe OT} Ajax with struts

2006-04-11 Thread Michael Jouravlev
For POST method add this in your code:

XHR.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");


On 4/11/06, vijay r <[EMAIL PROTECTED]> wrote:
> Yes, that was the problem.
>
> I changed the POST parameter to GET in http.open(); and its working. Keeping
> it POST and passing the parameters in send() does not work.
>
> Anyways, making it GET works and thats what I need. But what could be the
> problem?
>
> regards,
> vijay.
>
>
> On 4/11/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
> >
> > On 4/10/06, vijay r <[EMAIL PROTECTED]> wrote:
> > > Hello,
> > >
> > > I used AJAX to fill details for a corrosponding selected value listed in
> > a
> > > combo box. So for a particular registration number, the details of the
> > > vehicle are filled.
> > >
> > > On the onchange() event of the combo box, I am calling a JavaScript
> > function
> > > which creates a XmlHttpRequest with the url = "RegDetails.do
> > ?action=populate"
> > > where action is a DispatchAction parameter. I am working in Websphere
> > > Application Developer Studio and its working great in it. But when I
> > deploy
> > > the application in Websphere AS 5.0, the AJAX stuff does not work.
> > >
> > > Pre-population of the jsp form works great (which is also based on
> > > DispatchAction - I give
> > > http://localhost:9080/dpims/RegDetails.do?action=populate). Only the
> > AJAX
> > > stuff does not work. I get the following error
> > >
> > > [4/11/06 12:07:14:250 IST] 5fbb0406 DispatchActio E
> > > org.apache.struts.actions.DispatchAction  Request[/RegDetails] does not
> > > contain handler parameter named action
> > >
> > > I am not able to figure out the problem.
> >
> > If you use POST for your XHR, you must specify request parameters in
> > XHR.send(...) instead of appending them to action address. If you use
> > GET, well, your URL seems ok, I would pass null in XHR.send(...) but I
> > am not sure that this is the problem.
> >
> > Michael.
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: {Maybe OT} Ajax with struts

2006-04-11 Thread [EMAIL PROTECTED]
When you do a post you need to open the connection like so
server.open("POST",URL,false) where server is your xhr object.
To send as a post you need to encode your name value pairs to be sent and pass
them as the body of the request.
server.send(name=value&pairs=go&here=true);  then they will show up on the
server as parameters instead of attributes.


Bryan LaPlante

-- Original Message ---
From: "vijay r" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Tue, 11 Apr 2006 13:30:47 +0530
Subject: Re: {Maybe OT} Ajax with struts

> Yes, that was the problem.
> 
> I changed the POST parameter to GET in http.open(); and its working. Keeping
> it POST and passing the parameters in send() does not work.
> 
> Anyways, making it GET works and thats what I need. But what could be the
> problem?
> 
> regards,
> vijay.
> 
> On 4/11/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
> >
> > On 4/10/06, vijay r <[EMAIL PROTECTED]> wrote:
> > > Hello,
> > >
> > > I used AJAX to fill details for a corrosponding selected value listed in
> > a
> > > combo box. So for a particular registration number, the details of the
> > > vehicle are filled.
> > >
> > > On the onchange() event of the combo box, I am calling a JavaScript
> > function
> > > which creates a XmlHttpRequest with the url = "RegDetails.do
> > ?action=populate"
> > > where action is a DispatchAction parameter. I am working in Websphere
> > > Application Developer Studio and its working great in it. But when I
> > deploy
> > > the application in Websphere AS 5.0, the AJAX stuff does not work.
> > >
> > > Pre-population of the jsp form works great (which is also based on
> > > DispatchAction - I give
> > > http://localhost:9080/dpims/RegDetails.do?action=populate). Only the
> > AJAX
> > > stuff does not work. I get the following error
> > >
> > > [4/11/06 12:07:14:250 IST] 5fbb0406 DispatchActio E
> > > org.apache.struts.actions.DispatchAction  Request[/RegDetails] does not
> > > contain handler parameter named action
> > >
> > > I am not able to figure out the problem.
> >
> > If you use POST for your XHR, you must specify request parameters in
> > XHR.send(...) instead of appending them to action address. If you use
> > GET, well, your URL seems ok, I would pass null in XHR.send(...) but I
> > am not sure that this is the problem.
> >
> > Michael.
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
--- End of Original Message ---


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: {Maybe OT} Ajax with struts

2006-04-11 Thread vijay r
Yes, that was the problem.

I changed the POST parameter to GET in http.open(); and its working. Keeping
it POST and passing the parameters in send() does not work.

Anyways, making it GET works and thats what I need. But what could be the
problem?

regards,
vijay.


On 4/11/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
>
> On 4/10/06, vijay r <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I used AJAX to fill details for a corrosponding selected value listed in
> a
> > combo box. So for a particular registration number, the details of the
> > vehicle are filled.
> >
> > On the onchange() event of the combo box, I am calling a JavaScript
> function
> > which creates a XmlHttpRequest with the url = "RegDetails.do
> ?action=populate"
> > where action is a DispatchAction parameter. I am working in Websphere
> > Application Developer Studio and its working great in it. But when I
> deploy
> > the application in Websphere AS 5.0, the AJAX stuff does not work.
> >
> > Pre-population of the jsp form works great (which is also based on
> > DispatchAction - I give
> > http://localhost:9080/dpims/RegDetails.do?action=populate). Only the
> AJAX
> > stuff does not work. I get the following error
> >
> > [4/11/06 12:07:14:250 IST] 5fbb0406 DispatchActio E
> > org.apache.struts.actions.DispatchAction  Request[/RegDetails] does not
> > contain handler parameter named action
> >
> > I am not able to figure out the problem.
>
> If you use POST for your XHR, you must specify request parameters in
> XHR.send(...) instead of appending them to action address. If you use
> GET, well, your URL seems ok, I would pass null in XHR.send(...) but I
> am not sure that this is the problem.
>
> Michael.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: {Maybe OT} Ajax with struts

2006-04-11 Thread Michael Jouravlev
On 4/10/06, vijay r <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I used AJAX to fill details for a corrosponding selected value listed in a
> combo box. So for a particular registration number, the details of the
> vehicle are filled.
>
> On the onchange() event of the combo box, I am calling a JavaScript function
> which creates a XmlHttpRequest with the url = "RegDetails.do?action=populate"
> where action is a DispatchAction parameter. I am working in Websphere
> Application Developer Studio and its working great in it. But when I deploy
> the application in Websphere AS 5.0, the AJAX stuff does not work.
>
> Pre-population of the jsp form works great (which is also based on
> DispatchAction - I give
> http://localhost:9080/dpims/RegDetails.do?action=populate). Only the AJAX
> stuff does not work. I get the following error
>
> [4/11/06 12:07:14:250 IST] 5fbb0406 DispatchActio E
> org.apache.struts.actions.DispatchAction  Request[/RegDetails] does not
> contain handler parameter named action
>
> I am not able to figure out the problem.

If you use POST for your XHR, you must specify request parameters in 
XHR.send(...) instead of appending them to action address. If you use
GET, well, your URL seems ok, I would pass null in XHR.send(...) but I
am not sure that this is the problem.

Michael.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



{Maybe OT} Ajax with struts

2006-04-10 Thread vijay r
Hello,

I used AJAX to fill details for a corrosponding selected value listed in a
combo box. So for a particular registration number, the details of the
vehicle are filled.

On the onchange() event of the combo box, I am calling a JavaScript function
which creates a XmlHttpRequest with the url = "RegDetails.do?action=populate"
where action is a DispatchAction parameter. I am working in Websphere
Application Developer Studio and its working great in it. But when I deploy
the application in Websphere AS 5.0, the AJAX stuff does not work.

Pre-population of the jsp form works great (which is also based on
DispatchAction - I give
http://localhost:9080/dpims/RegDetails.do?action=populate). Only the AJAX
stuff does not work. I get the following error

[4/11/06 12:07:14:250 IST] 5fbb0406 DispatchActio E
org.apache.struts.actions.DispatchAction  Request[/RegDetails] does not
contain handler parameter named action

I am not able to figure out the problem.

regards,
vijay.


Re: ajax with struts

2006-03-23 Thread Mark Lowe
On 3/23/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
> Hello,
>
> The first thing I would suggest is this is one of those cases where the
> X in AJAX probably isn't appropriate.  Remember that there is NO
> requirement to use XML when doing AJAX (although I suppose it isn't AJAX
> then strictly speaking).
>
> Take Google Suggests for example.  They are not passing back XML, they
> are actually passing back, if memory serves, a chunk of Javascript that
> they execute.  I seem to recall it being just a Javascript array that is
> used to populate the dropdown, but I may not have all the details right.
>   The point though is that it isn't XML.
>
> Aside from that, one thing Google does too is they actually throttle the
> requests.  I don't have all the details, I just heard it explained once
> at a user group meeting, but basically, the faster a person types, the
> LESS requests go across, and that is dynamically calculated.
>
> Another thing you can do is write the code such that the request will
> only fire X number of milliseconds after the last keyUp is received.
> Maybe wait half a second after keyUp, and if a keyDown fires in the mean
> time, you reset the counter.  You would have to balance things so that
> the delay doesn't lead to a poor user experience, but I think that can
> be done. (I just saw Rick's reply as I was typing this, he makes the
> same basic suggestion).
>
> On the server-side, if possible, implement some sort of caching.
> Without knowing what kind of data you are using in your autocomplete, I
> can't make any specific suggestions.  But basically, if you can cache a
> subset of the most frequently used data on the server, then you won't
> have to hit the database as often.  Maybe its even possible to cache the
> entire database contents on the app server?
>
> At the end of the day there are two considerations: how many requests
> you make of the server, and what the server actually has to do to
> service the request.  If this is a LAN/WAN application, you will find
> the greater bottleneck is almost certainly what the server has to do.
> If it's Internet-based, the opposite may be true.  One bit of advice is
> to not assume you have a problem at all!  In this case you may, but do
> some basic testing first.  I've seen people assume that AJAX is horrible
> for network traffic when just the opposite wound up being true.  Then
> again, I've seen people who assumed just the opposite and got burned :)
>
> Frank
>
> Joel Alejandro Espinosa Carra wrote:
> > Hello all,
> >
> > I'm coding a simple action that retrieves some data from the database in
> > order to create an xml object for an ajax-based autocomplete field, I'm
> > worried about the load of the database beacuse this action is called
> > from a javascript event "onkeyup()" this means that the action will be
> > executed every time when user press a key in the field, is there an
> > other way to do this in order to increase the performance?

If your results aren't going to be large you could do a greedy query
on the first letter, and store the results as a javascript array
(sending the results as a javascript array may also be easier than
sending an xml). When a keyup happens on subsequent letters you could
search the javascript array rather than calling an action. There would
be a little more work on the javascript side, but you'd bother the
server less.

Mark

> >
> > pd. this is not a must-have requirement but I want to know what is the
> > best way to do this.
> >
> > Best regards.
> >
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM: fzammetti
> Yahoo: fzammetti
> MSN: [EMAIL PROTECTED]
> Java Web Parts -
> http://javawebparts.sourceforge.net
> Supplying the wheel, so you don't have to reinvent it!
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ajax with struts

2006-03-23 Thread Frank W. Zammetti

Hello,

The first thing I would suggest is this is one of those cases where the 
X in AJAX probably isn't appropriate.  Remember that there is NO 
requirement to use XML when doing AJAX (although I suppose it isn't AJAX 
then strictly speaking).


Take Google Suggests for example.  They are not passing back XML, they 
are actually passing back, if memory serves, a chunk of Javascript that 
they execute.  I seem to recall it being just a Javascript array that is 
used to populate the dropdown, but I may not have all the details right. 
 The point though is that it isn't XML.


Aside from that, one thing Google does too is they actually throttle the 
requests.  I don't have all the details, I just heard it explained once 
at a user group meeting, but basically, the faster a person types, the 
LESS requests go across, and that is dynamically calculated.


Another thing you can do is write the code such that the request will 
only fire X number of milliseconds after the last keyUp is received. 
Maybe wait half a second after keyUp, and if a keyDown fires in the mean 
time, you reset the counter.  You would have to balance things so that 
the delay doesn't lead to a poor user experience, but I think that can 
be done. (I just saw Rick's reply as I was typing this, he makes the 
same basic suggestion).


On the server-side, if possible, implement some sort of caching. 
Without knowing what kind of data you are using in your autocomplete, I 
can't make any specific suggestions.  But basically, if you can cache a 
subset of the most frequently used data on the server, then you won't 
have to hit the database as often.  Maybe its even possible to cache the 
entire database contents on the app server?


At the end of the day there are two considerations: how many requests 
you make of the server, and what the server actually has to do to 
service the request.  If this is a LAN/WAN application, you will find 
the greater bottleneck is almost certainly what the server has to do. 
If it's Internet-based, the opposite may be true.  One bit of advice is 
to not assume you have a problem at all!  In this case you may, but do 
some basic testing first.  I've seen people assume that AJAX is horrible 
for network traffic when just the opposite wound up being true.  Then 
again, I've seen people who assumed just the opposite and got burned :)


Frank

Joel Alejandro Espinosa Carra wrote:

Hello all,

I'm coding a simple action that retrieves some data from the database in 
order to create an xml object for an ajax-based autocomplete field, I'm 
worried about the load of the database beacuse this action is called 
from a javascript event "onkeyup()" this means that the action will be 
executed every time when user press a key in the field, is there an 
other way to do this in order to increase the performance?


pd. this is not a must-have requirement but I want to know what is the 
best way to do this.


Best regards.



--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ajax with struts

2006-03-23 Thread Rick Reumann

Joel Alejandro Espinosa Carra wrote the following on 3/23/2006 3:45 PM:


I'm worried about the load of the database beacuse this action is
called from a javascript event "onkeyup()" this means that the action
will be executed every time when user press a key in the field, is
there an other way to do this in order to increase the performance?


When you capture onKeyUp() start some sort of timer, so that the user 
has to pause for at least maybe 2 seconds(?) before you hit the server. 
This way if the user is just typing along quickly that ajax event won't 
fire.



--
Rick
http://www.learntechnology.net

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ajax with struts

2006-03-23 Thread Joel Alejandro Espinosa Carra

Hello all,

I'm coding a simple action that retrieves some data from the database in 
order to create an xml object for an ajax-based autocomplete field, I'm 
worried about the load of the database beacuse this action is called 
from a javascript event "onkeyup()" this means that the action will be 
executed every time when user press a key in the field, is there an 
other way to do this in order to increase the performance?


pd. this is not a must-have requirement but I want to know what is the 
best way to do this.


Best regards.

--
Ing. Joel Alejandro Espinosa Carra
CINVESTAV CTS - Centro de Tecnología de Semiconductores
Tel. +52 (33) 3770-3700 ext. 1049
http://www.cts-design.com 



--
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.
MailScanner agradece a transtec Computers por su apoyo.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]