Package org.takes.facets.flash
Class TkFlash
- java.lang.Object
-
- org.takes.facets.flash.TkFlash
-
- All Implemented Interfaces:
Take
public final class TkFlash extends Object implements Take
Take that understands Flash cookie and converts it into a HTTP header.This decorator helps your "take" to automate flash messages and destroy cookies on their way back, from the browser to the server. This is what a browser will send back:
GET / HTTP/1.1 Host: www.example.com Cookie: RsFlash=can%27t%20save%20your%20post%2C%20sorry/SEVERE
This decorator adds "Set-Cookie" with an empty value to the response. That's all it's doing. All you need to do is to decorate your existing "take", for example:
new FtBasic( new TkFlash(TkFork(new FkRegex("/", "hello, world!"))), 8080 ).start(Exit.NEVER); }
The class is immutable and thread-safe.
- Since:
- 0.1