struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yee, Richard K, CTR,, DMDCWEST" <Richard.Yee....@osd.pentagon.mil>
Subject RE: setAttribute
Date Thu, 30 Dec 2004 21:19:04 GMT
Jim,
request attributes are only available for the duration of the request which
is typically until the JSP is processed on the server. If you need the
variable to last for multiple pages, you should use session scope. You can
only set parameters after the user has pressed a button. You can either
submit the value of the button or have JavaScript set a html hidden input
field.

-Richard


-----Original Message-----
From: Jim Douglas [mailto:jdz99@hotmail.com] 
Sent: Thursday, December 30, 2004 12:58 PM
To: user@struts.apache.org
Subject: setAttribute


I set an attribute as follows...

public class AdsRespAction extends Action {

	public ActionForward execute(
		ActionMapping mapping,
		ActionForm Form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception {
   		.
                .
                request.setAttribute("adlist", list);
		return mapping.findForward("success");
	}
}


   I can loop through the adlist attribute in a jsp and build a table, no 
problem.  How long is the adlist attribute available?  Is it just for the 
page or multiple pages?

   Also, is there a way to set an attribute value in a page after the user 
has clicked on a specfic button? (and set it equal to the value of the 
button)

Jim



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

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


Mime
View raw message