You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Dong Qiu <do...@gmail.com> on 2014/02/11 08:11:58 UTC
HTTP PUT request with message body
Hi,
When I do a HTTP PUT request with message body. eg. x=12. It does not seem
to be put into the requestParamters. (e.g cannot find the x=12 entry in
request.getParameterMap )
I was told to try REST plugin. However, Just wondering why parsing the PUT
request message body and putting the entries into the paramterMap is not
supported in Struts2.3.16 core action?
Thank you
Re: HTTP PUT request with message body
Posted by Paul Benedict <pb...@apache.org>.
Here's the reason why (unrelated to Struts):
https://jira.springsource.org/browse/SPR-7030
On Tue, Feb 11, 2014 at 3:41 PM, Dong Qiu <do...@gmail.com> wrote:
> I issue the PUT request using Jquery's.
>
> $.ajax({
> url: '/test-action/99',
> type: 'PUT',
> data: "name=test",
> contentType : "application/x-www-form-urlencoded",
> success: function(data) {
> alert('...');
> }
> });
>
> (If I change PUT to POST, I can retrieve the name=test in test-action)
>
> I am using Jboss 7.0.2. Guess that http put method is not enabled in its
> Tomcat by default, so the "name=test"
> is not put into the requestParamterMap by the container and struts2 core
> actions do not handle parsing the msg body and put it into the Map for the
> PUT req.
>
> Thank you
>
>
>
>
> On Tue, Feb 11, 2014 at 7:19 AM, Paul Benedict <pb...@apache.org>
> wrote:
>
> > Dong, how are you issuing your HTTP PUT request? You can't do it through
> > HTML since HTML does not support those verbs. Are you doing it in
> > Javascript?
> >
> >
> > On Tue, Feb 11, 2014 at 5:06 AM, Dave Newton <da...@gmail.com>
> > wrote:
> >
> > > My initial guess would be because the additional HTTP verbs besides get
> > and
> > > post don't usually come from browsers.
> > > On Feb 11, 2014 2:12 AM, "Dong Qiu" <do...@gmail.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > When I do a HTTP PUT request with message body. eg. x=12. It does not
> > > seem
> > > > to be put into the requestParamters. (e.g cannot find the x=12 entry
> in
> > > > request.getParameterMap )
> > > >
> > > > I was told to try REST plugin. However, Just wondering why parsing
> the
> > > PUT
> > > > request message body and putting the entries into the paramterMap is
> > not
> > > > supported in Struts2.3.16 core action?
> > > >
> > > > Thank you
> > > >
> > >
> >
> >
> >
> > --
> > Cheers,
> > Paul
> >
>
>
>
> --
> Dong Qiu
>
--
Cheers,
Paul
Re: HTTP PUT request with message body
Posted by Dong Qiu <do...@gmail.com>.
I issue the PUT request using Jquery's.
$.ajax({
url: '/test-action/99',
type: 'PUT',
data: "name=test",
contentType : "application/x-www-form-urlencoded",
success: function(data) {
alert('...');
}
});
(If I change PUT to POST, I can retrieve the name=test in test-action)
I am using Jboss 7.0.2. Guess that http put method is not enabled in its
Tomcat by default, so the "name=test"
is not put into the requestParamterMap by the container and struts2 core
actions do not handle parsing the msg body and put it into the Map for the
PUT req.
Thank you
On Tue, Feb 11, 2014 at 7:19 AM, Paul Benedict <pb...@apache.org> wrote:
> Dong, how are you issuing your HTTP PUT request? You can't do it through
> HTML since HTML does not support those verbs. Are you doing it in
> Javascript?
>
>
> On Tue, Feb 11, 2014 at 5:06 AM, Dave Newton <da...@gmail.com>
> wrote:
>
> > My initial guess would be because the additional HTTP verbs besides get
> and
> > post don't usually come from browsers.
> > On Feb 11, 2014 2:12 AM, "Dong Qiu" <do...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > When I do a HTTP PUT request with message body. eg. x=12. It does not
> > seem
> > > to be put into the requestParamters. (e.g cannot find the x=12 entry in
> > > request.getParameterMap )
> > >
> > > I was told to try REST plugin. However, Just wondering why parsing the
> > PUT
> > > request message body and putting the entries into the paramterMap is
> not
> > > supported in Struts2.3.16 core action?
> > >
> > > Thank you
> > >
> >
>
>
>
> --
> Cheers,
> Paul
>
--
Dong Qiu
Re: HTTP PUT request with message body
Posted by Paul Benedict <pb...@apache.org>.
Dong, how are you issuing your HTTP PUT request? You can't do it through
HTML since HTML does not support those verbs. Are you doing it in
Javascript?
On Tue, Feb 11, 2014 at 5:06 AM, Dave Newton <da...@gmail.com> wrote:
> My initial guess would be because the additional HTTP verbs besides get and
> post don't usually come from browsers.
> On Feb 11, 2014 2:12 AM, "Dong Qiu" <do...@gmail.com> wrote:
>
> > Hi,
> >
> > When I do a HTTP PUT request with message body. eg. x=12. It does not
> seem
> > to be put into the requestParamters. (e.g cannot find the x=12 entry in
> > request.getParameterMap )
> >
> > I was told to try REST plugin. However, Just wondering why parsing the
> PUT
> > request message body and putting the entries into the paramterMap is not
> > supported in Struts2.3.16 core action?
> >
> > Thank you
> >
>
--
Cheers,
Paul
Re: HTTP PUT request with message body
Posted by Dave Newton <da...@gmail.com>.
My initial guess would be because the additional HTTP verbs besides get and
post don't usually come from browsers.
On Feb 11, 2014 2:12 AM, "Dong Qiu" <do...@gmail.com> wrote:
> Hi,
>
> When I do a HTTP PUT request with message body. eg. x=12. It does not seem
> to be put into the requestParamters. (e.g cannot find the x=12 entry in
> request.getParameterMap )
>
> I was told to try REST plugin. However, Just wondering why parsing the PUT
> request message body and putting the entries into the paramterMap is not
> supported in Struts2.3.16 core action?
>
> Thank you
>
Re: HTTP PUT request with message body
Posted by Greg Huber <gr...@gmail.com>.
Have you an example of code that you are using?
Cheers Greg
On 11 February 2014 07:11, Dong Qiu <do...@gmail.com> wrote:
> Hi,
>
> When I do a HTTP PUT request with message body. eg. x=12. It does not seem
> to be put into the requestParamters. (e.g cannot find the x=12 entry in
> request.getParameterMap )
>
> I was told to try REST plugin. However, Just wondering why parsing the PUT
> request message body and putting the entries into the paramterMap is not
> supported in Struts2.3.16 core action?
>
> Thank you
>