RE: Passing parameter to another Action class using POST
1 simple way + map = request.getParameterMap() + request.getSession().setAttribute(past_req_data,map); + redirect to next action + request.getSession().getAttribute(past_req_data); + request.getSession().removeAttribute(past_req_data); HTH -navjot |-Original Message- |From: Rajesh Khater [mailto:[EMAIL PROTECTED] |Sent: Wednesday, July 09, 2003 1:03 PM |To: Struts Users Mailing List |Subject: Passing parameter to another Action class using POST | | | |Hi, | |I need to pass some parameters to another action class from my action |class. I can do it using query String. But how can I send the parameters |using HTTP POST programmatically ?? | |Query strings also have some maximum length and my parameter values can |get pretty lengthy. | |Thanks, |Rajesh. | |**Disclaimer | |Information contained in this E-MAIL being proprietary to Wipro Limited is |'privileged' and 'confidential' and intended for use only by the individual | or entity to which it is addressed. You are notified that any |use, copying |or dissemination of the information contained in the E-MAIL in any manner |whatsoever is strictly prohibited. | |*** | |- |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: Passing parameter to another Action class using POST
You can set the attribute in the request as well. String string1 = Stuff ; request.setAttribute(Info, string1) ; Then later in the other action class, just do : String output = (String) request.getAttribute(Info) ; Rajesh Khater wrote: Hi, I need to pass some parameters to another action class from my action class. I can do it using query String. But how can I send the parameters using HTTP POST programmatically ?? Query strings also have some maximum length and my parameter values can get pretty lengthy. Thanks, Rajesh. **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** - 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: Passing parameter to another Action class using POST
Hi, Setting attributes in the request is fine .. But the other action class can also directly be called by a JSP, in which case it will have to do request.getParameter() , not request.getAttribute(). Of course, it can check if request.getParameter() returns null, then try for request.getAttribute(). But isn't there a way to send POST data programmatically ?? Thanks, Rajesh. -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 1:39 PM To: Struts Users Mailing List Subject: Re: Passing parameter to another Action class using POST You can set the attribute in the request as well. String string1 = Stuff ; request.setAttribute(Info, string1) ; Then later in the other action class, just do : String output = (String) request.getAttribute(Info) ; Rajesh Khater wrote: Hi, I need to pass some parameters to another action class from my action class. I can do it using query String. But how can I send the parameters using HTTP POST programmatically ?? Query strings also have some maximum length and my parameter values can get pretty lengthy. Thanks, Rajesh. **Disclaimer*** * Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** - 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] **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Passing parameter to another Action class using POST
snip But isn't there a way to send POST data programmatically ?? /snip Servlet API 2.3 supports the HttpServletRequestWrapper class so you could subclass and create one of these that returns the parameters you want. The tricky bit will be in having it used for the forwarding. You will probably need to play round with the RequestProcessor for that. An alternative is to forward to a page that writes out a form with hidden fields and submits to the other action but this involves the client side. -Original Message- From: Rajesh Khater [mailto:[EMAIL PROTECTED] Sent: Wednesday, 9 July 2003 16:31 To: Struts Users Mailing List Subject: RE: Passing parameter to another Action class using POST Hi, Setting attributes in the request is fine .. But the other action class can also directly be called by a JSP, in which case it will have to do request.getParameter() , not request.getAttribute(). Of course, it can check if request.getParameter() returns null, then try for request.getAttribute(). But isn't there a way to send POST data programmatically ?? Thanks, Rajesh. -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 1:39 PM To: Struts Users Mailing List Subject: Re: Passing parameter to another Action class using POST You can set the attribute in the request as well. String string1 = Stuff ; request.setAttribute(Info, string1) ; Then later in the other action class, just do : String output = (String) request.getAttribute(Info) ; Rajesh Khater wrote: Hi, I need to pass some parameters to another action class from my action class. I can do it using query String. But how can I send the parameters using HTTP POST programmatically ?? Query strings also have some maximum length and my parameter values can get pretty lengthy. Thanks, Rajesh. **Disclaimer*** * Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** - 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] **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** - 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: Passing parameter to another Action class using POST
If this is the case then I guess setting the attribute in the session is the easiest way to go. Rajesh Khater wrote: Hi, Setting attributes in the request is fine .. But the other action class can also directly be called by a JSP, in which case it will have to do request.getParameter() , not request.getAttribute(). Of course, it can check if request.getParameter() returns null, then try for request.getAttribute(). But isn't there a way to send POST data programmatically ?? Thanks, Rajesh. -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 1:39 PM To: Struts Users Mailing List Subject: Re: Passing parameter to another Action class using POST You can set the attribute in the request as well. String string1 = Stuff ; request.setAttribute(Info, string1) ; Then later in the other action class, just do : String output = (String) request.getAttribute(Info) ; Rajesh Khater wrote: Hi, I need to pass some parameters to another action class from my action class. I can do it using query String. But how can I send the parameters using HTTP POST programmatically ?? Query strings also have some maximum length and my parameter values can get pretty lengthy. Thanks, Rajesh. **Disclaimer*** * Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** - 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] **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** - 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]