public abstract static class Http.WrappedContext extends Http.Context
Http.Context.Implicit
args, current
Constructor and Description |
---|
WrappedContext(Http.Context wrapped) |
Modifier and Type | Method and Description |
---|---|
play.api.mvc.RequestHeader |
_requestHeader()
Deprecated.
Use
request() .asScala() instead. Since 2.7.0. |
boolean |
changeLang(Lang lang)
Change durably the lang for the current user.
|
boolean |
changeLang(java.lang.String code)
Change durably the lang for the current user.
|
void |
clearLang()
Clear the lang for the current user.
|
void |
clearTransientLang()
Clear the language for the current request, but don't
change the language cookie.
|
Http.Flash |
flash()
Returns the current flash scope.
|
java.lang.Long |
id()
The context id (unique)
|
Lang |
lang()
The current lang
|
Messages |
messages() |
Http.Request |
request()
Returns the current request.
|
Http.Response |
response()
Deprecated.
Deprecated as of 2.7.0. Use
Result instead. |
Http.Session |
session()
Returns the current session.
|
void |
setTransientLang(Lang lang)
Set the language for the current request, but don't
change the language cookie.
|
void |
setTransientLang(java.lang.String code)
Set the language for the current request, but don't
change the language cookie.
|
current, fileMimeTypes, toString, withRequest
public WrappedContext(Http.Context wrapped)
wrapped
- the context the created instance will wrappublic java.lang.Long id()
Http.Context
id
in class Http.Context
public Http.Request request()
Http.Context
request
in class Http.Context
@Deprecated public Http.Response response()
Result
instead.Http.Context
response
in class Http.Context
public Http.Session session()
Http.Context
session
in class Http.Context
public Http.Flash flash()
Http.Context
flash
in class Http.Context
@Deprecated public play.api.mvc.RequestHeader _requestHeader()
request()
.asScala() instead. Since 2.7.0.Http.Context
_requestHeader
in class Http.Context
public Lang lang()
Http.Context
lang
in class Http.Context
public boolean changeLang(java.lang.String code)
Http.Context
changeLang
in class Http.Context
code
- New lang code to use (e.g. "fr", "en-US", etc.)public boolean changeLang(Lang lang)
Http.Context
changeLang
in class Http.Context
lang
- New Lang object to usepublic void clearLang()
Http.Context
clearLang
in class Http.Context
public void setTransientLang(java.lang.String code)
Http.Context
setTransientLang
in class Http.Context
code
- the language code to set (e.g. "en-US")public void setTransientLang(Lang lang)
Http.Context
setTransientLang
in class Http.Context
lang
- the language to setpublic void clearTransientLang()
Http.Context
clearTransientLang
in class Http.Context
public Messages messages()
messages
in class Http.Context