curl
can be used to send cookies to test so not all is lost.
Alright, if I have not talked you out of using them yet, you must have a need for them. (Please rethink the idea though).
Use of cookies is accomplished by using the
@CookieParam
annotation. Also you can return responses as shown in the code below which include cookies.Cookies have a limitations on the use of some characters, and names so please look at the RFC noted above for additional limitations. I demonstrate a couple of limitations which include the use of semi-colons (;), and commas(,). The nice thing about this example is you can see the output in a real browser (Internet Explorer not included) since most can handle application/json objects which are returned.
Here is the example code developed using NetBeans 7.1 RC2 and GlassFish 3.1.1: cookie-parameters.zip
0 comments :
Post a Comment