cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <ajuf...@sun3.oulu.fi>
Subject Re: Cocoon 2.2 PUT HTTP request
Date Wed, 22 Sep 2010 18:46:00 GMT
On 09/22/2010 06:44 PM, Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Andre,
>
> On 9/22/2010 3:36 AM, Andre Juffer wrote:
>>> Try confirming (say, with LiveHttpHeaders) that the PUT is being
>>> redirected by the server.
>>
>> This is what I see with LiveHttpHeaders:
>>
>>   http://localhost:8888/equipment/
>>
>> POST /equipment/ HTTP/1.1
>
> No, I meant try to PUT to http://localhost:8888/equipment (no trailing
> slash) and see if the server redirects you. Also, it would be nice to to
> know what kind of redirect is being issued. If a 303 response is being
> generated, then the client is supposed to use a GET method for the
> followup request. Other response codes have other meanings.

OK, sorry about that. Here is the output and I think you are right. It 
actually generates 302 instead of of a 303 response, but the effect is 
probably the same (according to Wikipedia). The second request is not 
mine and is actually a GET request. Note that cocoon 2.2 is about two 
years old and has not been updated since then. I hope cocoon 3 goes main 
stream soon now.

http://localhost:8888/equipment

PUT /equipment HTTP/1.1
Host: localhost:8888
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.10) 
Gecko/20100915 Ubuntu/10.04 (lucid) Firefox/3.6.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: http://localhost:8888/ui/start
Content-Length: 94
Cookie: JSESSIONID=hr0mt4clb1k4; 
webfx-tree-cookie-persistence=wfxt-4+wfxt-6; 
PPA_ID=9qtajhe4ckjkj3mr200ck8jbo3
name=tester&task=tester&category=tester&manufacturer=tester&description=tester&ownerId=3375104

HTTP/1.1 302 Found
X-Cocoon-Version: 2.2.0
Location: http://localhost:8888/equipment/
Content-Length: 0
Server: Jetty(6.1.7)

----------------------------------------------------------
http://localhost:8888/equipment/

GET /equipment/ HTTP/1.1
Host: localhost:8888
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.10) 
Gecko/20100915 Ubuntu/10.04 (lucid) Firefox/3.6.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://localhost:8888/ui/start
Cookie: JSESSIONID=hr0mt4clb1k4; 
webfx-tree-cookie-persistence=wfxt-4+wfxt-6; 
PPA_ID=9qtajhe4ckjkj3mr200ck8jbo3

HTTP/1.1 200 OK
X-Cocoon-Version: 2.2.0
Content-Type: application/json; charset=UTF-8
Content-Length: 1838
Server: Jetty(6.1.7)
----------------------------------------------------------

Under 'generator' I find (note the redirect)

#request# PUT http://localhost:8888/equipment
PUT /equipment
name=tester&task=tester&category=tester&manufacturer=tester&description=tester&ownerId=3375104


#request# GET http://localhost:8888/equipment/
#redirect# GET /equipment/



>
>> [W]ith cocoon one can create very easily various
>> resource representation using XSLT, without the need the hardcode this
>> into Java. Cocoon 3 (there is an alpha version) is better prepared for
>> REST.
>
> Excellent. Good luck.

Thanks. And thanks again for your feedback. That was extremely helpful. 
I sincerely hope that you are able to get the request for a new feature 
related to PUT requests in the next version of Tomcat! Many users will 
be very about that (including me).

André

>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkyaJEAACgkQ9CaO5/Lv0PBapgCeJuwk/PWW1x+mBKa8gA7x8k6J
> paUAnita0RxYiQkAVPogO19b/E+tmCzX
> =TbU7
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


-- 
Andre H. Juffer              | Phone: +358-8-553 1161
Biocenter Oulu and           | Fax: +358-8-553-1141
Department of Biochemistry   | Email: andre.juffer@oulu.fi
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/
StruBioCat                   | WWW: www.strubiocat.oulu.fi
NordProt                     | WWW: www.nordprot.org
Triacle Biocomputing         | WWW: www.triacle-bc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message