public final class TsFlash extends Object implements Takes
This decorator helps your "takes" 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 "takes", for example:
new FtBasic( new TsFlash(TsFork(new FkRegex("/", "hello, world!"))), 8080 ).start(Exit.NEVER); }
The class is immutable and thread-safe.
public TsFlash(Takes takes)
takes
- Original takespublic Take route(Request request) throws IOException
Takes
route
in interface Takes
request
- The request to dispatchIOException
- If failsCopyright © 2015 Takes. All rights reserved.