-
1. Re: Can I submit a form using GET for processAction?
hoang_to Mar 28, 2011 10:23 PM (in response to rraposa)I think the explaination comes from the protocol used for request handling.
1. When user interacts with portlets, ActionRequest is sent
2. ActionRequest handling (reset the state of portlet window,...) eventually results in EventRequest
3. Once all EventRequest have been processed, RenderRequest is sent to each portlet
( You could see the sequential diagram in page 43 of the spec)
We learn that ActionRequest is not designed to retreive data, whereas the GET HTTP is designed to get data....
-
2. Can I submit a form using GET for processAction?
rraposa Mar 28, 2011 11:51 PM (in response to hoang_to)That is good information, but I don't quite see what different it should make behind-the-scenes whether or not the request is GET vs. POST. I'm sure there is a good reason for it - but if not, it should be something that perhaps we can change.
Here is my use-case: I have a form with dozens of options and I want the users to be able to bookmark the page that displays the results so they can come back later and not re-enter the form criteria, or email the link to themselves, so I want to submit the form using GET.
-
3. Re: Can I submit a form using GET for processAction?
trong.tran Mar 29, 2011 2:15 AM (in response to rraposa)Actually the ProcessAction does not care about whatever it's the POST or GET.
The problem here is that the agent ( browser ) send requests in POST and GET in different target URL. Let say that in the form you have action="/portal/private/classic/test?foo=bar" and an input with name/value :
1/ if the form is sent by POST, the target URL will be kept as whole value in the action, that is "/portal/private/classic/test?foo=bar".
2/ if it's sent by GET, the target URL will be re-composed by taking only "/portal/private/classic/test" part from the value of the action ( which is before "?" ) AND plus with name/value of the inputs converted as query string. That is "/portal/private/classic/test?name=value".
In the case with GET, it's losing some information identified by Portal to know where exactly the request sent to. That's why the ProcessAction will not invoked.
I'm not sure if this behaviour should be identified/handled by Portal itself BUT absolutely you could treat it with Javascript somehow to get your usecase work
-
4. Can I submit a form using GET for processAction?
rraposa Mar 29, 2011 9:21 AM (in response to trong.tran)1 of 1 people found this helpfulThanks Trong - you are correct. If I submit the form using GET, the URL looks like:
If I submit the form using POST, the URL looks like:
To clarify, the value of "action" in the <form> tag is the same for both, but the browser is rewriting the URL before sending it and clearly removing the important information about which portlet to send the request to.
I will research how others have designed portal pages that can be bookmarked. Thanks for your help!