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 <mgai...@hotmail.com> wrote:
> 
> From: Martin Gainty <mgai...@hotmail.com>
> Subject: RE: Struts w/Ajax with Struts again
> To: "Struts Users Mailing List" <user@struts.apache.org>
> 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" %>
> 
> <html>
> 
> <body> 
> 
>   <s:bean name="package.bean" id="id">
>         <s:param name="BeanParamName">BeanParam</s:param> 
>           <s:property value="%{BeanParamName}" /><br>
>       </s:bean>
> 
> </body>
> 
> </html>
> 
> 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 <mgai...@hotmail.com> wrote:
> > 
> > From: Martin Gainty <mgai...@hotmail.com>
> > Subject: RE: Struts w/Ajax with Struts again
> > To: "Struts Users Mailing List" <user@struts.apache.org>
> > 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
> 
> _________________________________________________________________
> Windows Live™ SkyDrive™: Store, access, and share your photos. See how.
> http://windowslive.com/Online/SkyDrive?ocid=TXT_TAGLM_WL_CS_SD_photos_072009

_________________________________________________________________
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

Reply via email to