Hello: You can use session context if implements SessionAware for example:
public class MyAction extends ActionSupport implements SessionAware { private Map session; public String execute() { session.put("categoryList", EComplaintType.values()) return SUCCESS; } public void setSession(Map session) { this.session = session; } } SALUDOS!! Mario HIDALGO Java EE Consultant | Risk IT ___________________________________________________________________ Phone 1. (722) 2799997 ext. 783042 Phone 2. (55) 5721 2222 opción 3 , ext. 783042 Mobile. 0447223547727 Email. mario.hida...@hsbc.com.mx Internet. HSBC México ___________________________________________________________________ Alex Rodriguez Lopez <alo...@flordeutopia.pt> 27 Apr 2010 04:23 AM Mail Size: 7370 Please respond to "Struts Users Mailing List" <user@struts.apache.org> To Struts Users Mailing List <user@struts.apache.org> cc Subject Re: struts session help Hi, you could put/get from session like so: ActionContext.getContext().getSession(); You can define a "parent" action (implementing preparable) with a prepare() method that retrieves data and store it in session for later (and check each time if data is already in session) and puts it into properties with public getters that your other actions extending that one (and jsps) will inherit. Em 27-04-2010 09:36, Upasana Sharma escreveu: > Hi > > I have a jsp that displays some data . To refine the data based on some > criteria i have two comboboxes. > > <s:select list="categoryList" id="categorySelect" name="categorySelect" > onchange="getDisplayCriteria();" emptyOption="true"></s:select> > > <s:select list="statusList" id="statusSelect" name="statusSelect" > onchange="getDisplayCriteria();" emptyOption="true"></s:select> > > > the lists for these two select option are obtained from the action that > calls the page containing them.. > > public String getAllLists() throws Exception{ > > ActionContext.getContext().put("categoryList", EComplaintType.values()); > ActionContext.getContext().put("statusList", EComplaintStatus.values()); > return SUCCESS; > } > > but the problem is that whatever we put in this action context , those > values are for that action only.... if we call any other action that renders > the same jsp.... these values are not accessible. > > there is some issue with session management what i feel... can u suggest how > should i approach this problem...... to make the values stay in the session > after the first call. > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org "This email may contain confidential information, and is intended only for the named recipient and may be privileged. Distribution or copying of this email by anyone other than the named recipient is prohibited. If you are not the named recipient, please notify us immediately and permanently destroy this email and all copies of it. Internet email is not private, secure, or reliable. No member of the HSBC Group is liable for any errors or omissions in the content or transmission of this email. Any opinions contained in this email are solely those of the author, and unless clearly indicated otherwise in writing, are not endorsed by any member of the HSBC group." “Este correo electrónico puede contener información confidencial, sólo está dirigida al destinatario del mismo, la información puede ser privilegiada. Está prohibido que cualquier persona distinta al destinatario copie o distribuya este correo. Si usted no es el destinatario, por favor notifíque esto de inmediato y destruya el correo, lo mismo que todas las copias que existan del mismo. Los correos electrónicos en internet, no son privados, seguros ni confiables. Ningún miembro del Grupo HSBC será responsable de los errores u omisiones en el contenido o transmisión de este correo electrónico. Cualquier opinión contenida en este correo es responsabilidad única y exclusiva del autor del mismo y, a menos que lo contrario se indique claramente y por escrito, no está respaldado por ningún miembro del Grupo HSBC”. "This email may contain confidential information, and is intended only for the named recipient and may be privileged. Distribution or copying of this email by anyone other than the named recipient is prohibited. If you are not the named recipient, please notify us immediately and permanently destroy this email and all copies of it. Internet email is not private, secure, or reliable. No member of the HSBC Group is liable for any errors or omissions in the content or transmission of this email. Any opinions contained in this email are solely those of the author, and unless clearly indicated otherwise in writing, are not endorsed by any member of the HSBC group." “Este correo electrónico puede contener información confidencial, sólo está dirigida al destinatario del mismo, la información puede ser privilegiada. Está prohibido que cualquier persona distinta al destinatario copie o distribuya este correo. Si usted no es el destinatario, por favor notifíque esto de inmediato y destruya el correo, lo mismo que todas las copias que existan del mismo. Los correos electrónicos en internet, no son privados, seguros ni confiables. Ningún miembro del Grupo HSBC será responsable de los errores u omisiones en el contenido o transmisión de este correo electrónico. Cualquier opinión contenida en este correo es responsabilidad única y exclusiva del autor del mismo y, a menos que lo contrario se indique claramente y por escrito, no está respaldado por ningún miembro del Grupo HSBC”.