Define a simple POJO with a default constructor (required by Jackson)
public class SampleObject implements Serializable {
private String myString;
public SampleObject() {}
public String getMyString() {
return myString;
}
public void setMyString(String myString) {
this.myString = myString;
}
}
Set Cookie
CookieBaker.saveCookie(response, cookieName, mySampleObjectInstance);
Get Cookie
SampleObject o = CookieBaker.getCookie(request, SampleObject.class, cookieName);
JUnit, Servlet API, Jackson, Spring Test
git clone git@github.com:feliperazeek/CookieBaker.git
cd CookieBaker
mvn install
Import jar to your CLASSPATH or add Maven dependency to your project.
<dependency>
<groupId>geeks.aretotally.in</groupId>
<artifactId>cookiebaker</artifactId>
<version>0.1</version>
</dependency>
Integrate HTML5 Local Storage with browser auto-detection.
The GNU General Public License, or GPL, is an open source license. Open source doesn't just mean that you can view the source code — it has political and philosophical implications as well. Open source, or "Free Software", means you are free to modify and redistribute the source code under certain conditions. Free doesn't refer to the price, it refers to freedom. The difference between the two meanings of free is often characterized as "Free as in speech vs. free as in beer." The GPL is free as in speech.
Felipe Oliveira (felipera at gmail dot com)
Blog: Geeks Are Totally In!
Twitter: @_felipera
You can download this project in either zip or tar formats.
You can also clone the project with Git by running:
$ git clone git://github.com/feliperazeek/CookieBaker