Package org.actioncontroller.values.json
Annotation Type UnencryptedJsonCookie
-
@Target(PARAMETER) @Retention(RUNTIME) public @interface UnencryptedJsonCookie
Create a cookie that is parsed to and from JSON. IfsetInResponse = true, the cookie will be written back to the response after the method completes. If the cookie is not read, it is initialized as "{}" (an empty JSON object) For example:@POST("/changeUser") public void changeUser( @UnencryptedJsonCookie(value = "userSession", setInResponse = true) Map<String, String> userSession, @RequestParameter("newUserName") String newUserName ) { logger.info("Changing username from {} to {}", userSession.get("username"), newUserName); userSession.set("username"); }The first time this method (or any like it) is called over http, the client gets a cookie with a value like{"username": "something"}. Every time the method is called, a new cookie is returned to the client
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanisHttpOnlyIf false, omits the HttpOnly flag on the cookie, meaning that the cookie can be read by client-side JavaScript.booleansecureIf false, omits the Secure flag on the cookie, meaning that the cookie will be sent over HTTP as well as HTTPS.booleansetInResponseStringvalueThe name of the cookie
-
-
-
Element Detail
-
value
String value
The name of the cookie- Default:
- ""
-
-