|
From: Ron S. <rs...@re...> - 2012-10-16 01:55:29
|
Ok, I've put in the fix.
On 10/15/2012 03:29 PM, Bill Burke wrote:
> Err...PUT has meaning. PUT + form parameters should be supported.
>
> On 10/15/2012 1:43 PM, Ron Sigal wrote:
>> My mistake. I was using PUT when I thought I was using POST. For POST,
>> jbossweb returns both the query and the form parameters.
>>
>> So, I guess the answer is: USE POST. FORGET PUT. Is that reasonable?
>>
>> Or, I can include my fix that makes it work with PUT. Bill, wdyt?
>>
>> Sorry for the confusion, Remy. :(
>>
>> On 10/15/2012 01:25 PM, Ron Sigal wrote:
>>> On 10/15/2012 12:12 PM, Rémy Maucherat wrote:
>>>> On 10/15/2012 03:40 PM, Bill Burke wrote:
>>>>> Please move these types of discussions to the dev list.
>>>> Ok, but I am not subscribed to it.
>>> WHAT?!?! I thought everyone was on the Resteasy dev list. I'm pretty
>>> sure Francois Holland is on the list. Also, Voltaire. But not Marie Le
>>> Pen. She's on the jersey dev list. ;)
>>>
>>>>> But, for form processing, there's a few things you have to worry about.
>>>>>
>>>>> 1) Did a Servlet filter eat the input stream? You'll need to use
>>>>> getParameterMap() then.
>>>>> 2) Is it a POST or PUT? If PUT, does getParameterMap() eat the form
>>>>> input stream or not?
>>>>> 3) If its Tomcat, a PUT, and the filter ate the input stream, you're
>>>>> up shit creek.
>>>> The spec is quite clear that it deals with URL encoded POSTs, so I
>>>> understand the real problems started when other containers thought it
>>>> would be nice to ignore specs and do what users asked for. So the
>>>> option to also process PUT should be added to AS then ?
>>> I'm not sure why the user wants to use PUT. But I get the same problem
>>> with POST. Here's my test, on the client side:
>>>
>>> @Test
>>> public void testFormParamWithQueryParamPost() throws Exception
>>> {
>>> ClientRequest request = new
>>> ClientRequest("http://localhost:8080/RESTEASY-760/post/query?query=xyz");
>>> request.formParameter("formParam", "abc");
>>> request.header("Content-Type", "application/x-www-form-urlencoded");
>>> ClientResponse<String> response = request.put(String.class);
>>> assertTrue(response != null);
>>> System.out.println("response: " + response.getEntity());
>>> assertEquals("abc", response.getEntity());
>>> }
>>>
>>> When Resteasy calls
>>> javax.servlet.http.HttpServletRequest..getParameterMap(), it gets
>>> query=xyz but not formParam=abc. Maybe I'm doing something wrong?
>>>
>>>> Rémy
>>>>
--
My company's smarter than your company (unless you work for Red Hat).
|