@Singleton public class CookieSessionMapper extends Object implements SessionMapper
Implement SessionMapper
with HTTP cookie
Constructor and Description |
---|
CookieSessionMapper(AppConfig conf) |
Modifier and Type | Method and Description |
---|---|
String |
readFlash(org.osgl.http.H.Request request)
Read the incoming HTTP request and extract serialized flash state.
|
String |
readSession(org.osgl.http.H.Request request)
Read the incoming HTTP request and extract serialized session state.
|
void |
write(String session,
String flash,
org.osgl.http.H.Response response)
Write serialized session and flash state into
response . |
@Inject public CookieSessionMapper(AppConfig conf)
public void write(String session, String flash, org.osgl.http.H.Response response)
SessionMapper
Write serialized session and flash state into response
.
write
in interface SessionMapper
session
- the session state (a string) to be written to the responseflash
- the flash state (a string) to be written to the responseresponse
- the HTTP responsepublic String readSession(org.osgl.http.H.Request request)
SessionMapper
Read the incoming HTTP request and extract serialized session state.
readSession
in interface SessionMapper
request
- the incoming HTTP requestnull
if not session state found in the request using this mapperpublic String readFlash(org.osgl.http.H.Request request)
SessionMapper
Read the incoming HTTP request and extract serialized flash state.
readFlash
in interface SessionMapper
request
- the incoming HTTP requestnull
if not flash state found in the request using this mapperCopyright © 2014–2018 ActFramework. All rights reserved.