View Full Version : start-state POST
ricsouzamoura
Jul 29th, 2005, 03:18 PM
My start-state is a class that extends AbstractAction.
When I send request parameters by get it works well, but when I send request parameters by POST it don't works.
There is some diference ?
I have tried to use context.getSourceEvent().getParameter(), context.getSourceEvent().getAttribute(), context.getRequestScope().getAttribute() but I didn't get.
context = RequestContext
Thanks in advance
klr8
Jul 30th, 2005, 01:59 AM
There should be no difference. It's the servlet engine, e.g. Tomcat, that handles the difference and makes all request parameters available using 'request.getParameter("name")'. Inside of SWF, the HTTP servlet request is wrapped inside an Event, so you should be able to get the value of any request paremeter using 'context.getSourceEvent().getParameter("name")', no matter whether it was sent using HTTP GET or POST.
Do you get the correct value if you do:
HttpServletRequest request = ((ServletEvent)context.getSourceEvent()).getReques t();
request.getParameter("name");
//assertEquals(context.getSourceEvent().getParameter ("name"), request.getParameter("name"));
If the last assert fails, please let us know because that might be a bug.
Erwin
ricsouzamoura
Aug 1st, 2005, 09:14 AM
Unfortunatelly it doesn't work too.
When I use GET everything works well, but POST....
I will try to show you how is my application.
It is a shopping cart to a e-commerce application.
I have a form like this:
<form action="/secure/shoppingcart.do" method="POST">
<input type="hidden" name="codProd" value="1"/>
<input type="hidden" name="codItem" value="10"/>
<input type="hidden" name="amount" value="1"/>
<input type="hidden" name="codProd" value="2"/>
<input type="hidden" name="codItem" value="20"/>
<input type="hidden" name="amount" value="1"/>
<input type="submit" value="OK"/>
</form>
When I click on OK, this URL pass by Acegi Security filters and change to security channel (https)
for example: the codProd parameter should have been passed like a String[] with 2 elements, but when I used what you suggest it returned null
I have tried all that options, but It just worked when I have used GET.
I am using Tomcat-5.5.7, Apache-2.0.52 webflow r3, spring 1.2, JDK-1.5.0_03 SUN.
If you still have some more questions, feel free to ask
I apreciatte if you can spend your time with this problem...
klr8
Aug 1st, 2005, 09:28 AM
Could it be the Acegi stuff and the switch to HTTPS that is messing with the request parameters? Have you tried disabling your security, just as a test, and see if that works?
If that's not it, I have absolutely no idea what could be happening to those request parameters. It's unlikely that it's a problem in SWF though.
Erwin
ricsouzamoura
Aug 1st, 2005, 12:54 PM
Everything works without https. It could be a wrong configuration or a bug in Acegi... I will read more about to see if I get the reason...
Thank you very much by the tip...
When I have a answer about the problem after my researches I post a reply...
ricsouzamoura
Aug 1st, 2005, 01:25 PM
Ok... I understood now.
When I use Acegi, it make a redirect to https using the class RetryWithHttpsEntryPoint
a piece of javadoc is bellow:
"public class RetryWithHttpsEntryPoint extends Object implements InitializingBean, ChannelEntryPoint
Commences a secure channel by retrying the original request using HTTPS.
This entry point should suffice in most circumstances. However, it is not intended to properly handle HTTP POSTs or other usage where a standard redirect would cause an issue. "
Thank you
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.