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 Tue, 21 Sep 2010 20:26:27 GMT
Chris,

I got it working now. It is really in the details.

I always relied upon a PUT request like

http://localhost:8888/equipment

expecting to see the request method set to PUT. In fact, it was always GET.

If, however, one employs

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

(Notice the forward slash at the end!)

then the request method is set to PUT. Requests parameters are not 
available, at least not with Jetty 1.6.7 (and I would assume the same is 
true for tomcat 6 and 7, did not check). This is what one could expect, 
as the specification does not require the availability of the request 
parameters. A GET request with request parameters should also use the 
forward slash at the end like

http://localhost:8888/equipment/?para1=val1&param2=val2

But a GET without parameters like

http://localhost:8888/equipment/123456

is OK (is always interpreted as a GET).

Using a POST request instead (and with the forward slash), the request 
method is POST and all parameters are now available through the 
getParameter() family of methods ion flowscript. I've not tried any of 
the other request methods like DELETE.

So, this leaves us with the issue with PUT not having the parameters 
available, but at least the request method is now properly set.

I was almost ready to switch to a different framework like 
https://jersey.dev.java.net/. Almost ....

Thanks,
André

On 09/21/2010 09:40 PM, Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Andre,
>
> On 9/21/2010 2:04 PM, Andre Juffer wrote:
>> On 09/21/2010 07:38 PM, Christopher Schultz wrote:
>>> I find the Cocoon documentation very difficult to navigate. Can you
>>> point me to the documentation for calling javascript functions? All I
>>> could find was this:
>>> http://cocoon.apache.org/2.2/core-modules/core/2.2/844_1_1.html
>>
>> Yeah, it is not that well organized. Have a look at:
>>
>> http://cocoon.apache.org/2.2/blocks/flowscript/1.0/1241_1_1.html
>
> In the examples, I see them use code like this:
>
> cocoon.request.get("foo")
>
> to get a request parameter. get() is not a standard method on
> HttpServletRequest, so this must be some kind of wrapper around
> HttpServletRequest.
>
> There seems to be nothing about working with<map:parameter>  elements
> from the sitemap in the flowscript. :(
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkyY/CgACgkQ9CaO5/Lv0PDbZgCfSd98cokDRntfHnLRMkDLduTz
> 0LAAoKlpGlBDntPj09UTTlyVID7OZkS+
> =JCr8
> -----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