The accountId value is in the query string of the request and therefore must be retrieved like:
String accountIdValue = request.getParameter("accountId"); robert > -----Original Message----- > From: Shih-gian Lee [mailto:[EMAIL PROTECTED] > Sent: Sunday, November 28, 2004 7:24 PM > To: Struts Users Mailing List > Subject: Re: How to retrieve parameters passed via GET method? > > > > In my Struts configuration file, an action element is defined as the > > following: > > <action path="/closeAccount" > > type="org.apache.struts.actions.ForwardAction" > > parameter="/closeAccount.jsp" /> > > > > When customer clicks on the hyperlink, ActionServlet receives the HTTP > > request, pre-processes it and forwards it to > ForwardAction, who will simply forward the request to closeAccount.jsp. That > page then asks customer to confirm the > operation ("are you sure that you want to close account No. 100?"). The > problem is, ActionServlet seems to have modified > the request, so in my closeAccount.jsp, i cannot retrieve the accountId > parameter: request.getAttribute("accountId") returns null. > > > > I dumped the contents in the HTTP request that closeAccount.jsp receives. > > They look like this: > > javax.servlet.forward.request_uri = /badba/closeAccount.do > > javax.servlet.forward.context_path = /badba > javax.servlet.forward.servlet_path = /closeAccount.do > javax.servlet.forward.query_string = accountId=100 > org.apache.struts.action.mapping.instance = > ActionConfig[path=/closeAccount,parameter=/closeAccount.jsp,scope=session,type=org.apache.struts.actions.ForwardAction > org.apache.struts.action.MODULE = [EMAIL PROTECTED] > > > > Is it possible that the accountId is saved in session scope instead of > request scope? > > You need to specify the scope if you want to save it in "request" scope: > > <action path="/closeAccount" > type="org.apache.struts.actions.ForwardAction" > parameter="/closeAccount.jsp" scope="request"/> > > HTH. > > Lee > > --------------------------------------------------------------------- > 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]