@Deprecated
public static class Http.Context
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Http.Context.Implicit
Deprecated.
Deprecated as of 2.7.0. Use
Result instead. |
Modifier and Type | Field and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
args
Deprecated.
Deprecated as of 2.7.0. Use request attributes instead.
|
static java.lang.ThreadLocal<Http.Context> |
current
Deprecated.
Deprecated as of 2.7.0. Use
a request instead.
|
Constructor and Description |
---|
Context(Http.RequestBuilder requestBuilder,
play.core.j.JavaContextComponents components)
Deprecated.
Creates a new HTTP context.
|
Context(Http.Request request,
play.core.j.JavaContextComponents components)
Deprecated.
Creates a new HTTP context.
|
Context(java.lang.Long id,
play.api.mvc.RequestHeader header,
Http.Request request,
Http.Response response,
Http.Session session,
Http.Flash flash,
java.util.Map<java.lang.String,java.lang.Object> args,
play.core.j.JavaContextComponents components)
Deprecated.
Use
#Context(Long, play.api.mvc.RequestHeader, Request, Response, Session,
Flash, Map, Lang, JavaContextComponents) instead. Since 2.7.0. |
Context(java.lang.Long id,
play.api.mvc.RequestHeader header,
Http.Request request,
Http.Response response,
Http.Session session,
Http.Flash flash,
java.util.Map<java.lang.String,java.lang.Object> args,
Lang lang,
play.core.j.JavaContextComponents components)
Deprecated.
Creates a new HTTP context, using the references provided.
|
Context(java.lang.Long id,
play.api.mvc.RequestHeader header,
Http.Request request,
java.util.Map<java.lang.String,java.lang.String> sessionData,
java.util.Map<java.lang.String,java.lang.String> flashData,
java.util.Map<java.lang.String,java.lang.Object> args,
play.core.j.JavaContextComponents components)
Deprecated.
Creates a new HTTP context.
|
Context(java.lang.Long id,
play.api.mvc.RequestHeader header,
Http.Request request,
java.util.Map<java.lang.String,java.lang.String> sessionData,
java.util.Map<java.lang.String,java.lang.String> flashData,
java.util.Map<java.lang.String,java.lang.Object> args,
Lang lang,
play.core.j.JavaContextComponents components)
Deprecated.
Creates a new HTTP context.
|
Modifier and Type | Method and Description |
---|---|
play.api.mvc.RequestHeader |
_requestHeader()
Deprecated.
Use
request() .asScala() instead. Since 2.7.0. |
boolean |
changeLang(Lang lang)
Deprecated.
Deprecated as of 2.7.0. Use
MessagesApi.setLang(Result, Lang) . |
boolean |
changeLang(java.lang.String code)
Deprecated.
Deprecated as of 2.7.0. Use
MessagesApi.setLang(Result, Lang) . |
static void |
clear()
Deprecated.
Deprecated as of 2.7.0. Use
a request instead.
|
void |
clearLang()
Deprecated.
Deprecated as of 2.7.0. Use
MessagesApi.clearLang(Result) . |
void |
clearTransientLang()
Deprecated.
Deprecated as of 2.7.0. See
migration guide..
|
static Http.Context |
current()
Deprecated.
Deprecated as of 2.7.0. Use
a request instead.
|
FileMimeTypes |
fileMimeTypes()
Deprecated.
Deprecated as of 2.7.0. Inject
FileMimeTypes instead. |
Http.Flash |
flash()
Deprecated.
Deprecated as of 2.7.0. Use
Http.RequestHeader.flash() and Result instead. |
java.lang.Long |
id()
Deprecated.
Deprecated as of 2.7.0 Use
Http.RequestHeader.id() instead. |
Lang |
lang()
Deprecated.
Deprecated as of 2.7.0. See
migration guide..
|
Messages |
messages()
Deprecated.
Deprecated as of 2.7.0. See
migration guide..
|
Http.Request |
request()
Deprecated.
Deprecated as of 2.7.0. See
migration guide..
|
Http.Response |
response()
Deprecated.
Deprecated as of 2.7.0. Use
Result instead. |
static java.util.Optional<Http.Context> |
safeCurrent()
Deprecated.
Deprecated as of 2.7.0. Use
a request instead.
|
Http.Session |
session()
Deprecated.
Deprecated as of 2.7.0. Use
Http.RequestHeader.session() and Result instead. |
static void |
setCurrent(Http.Context ctx)
Deprecated.
Deprecated as of 2.7.0. Use
a request instead.
|
void |
setTransientLang(Lang lang)
Deprecated.
Deprecated as of 2.7.0. See
migration guide..
|
void |
setTransientLang(java.lang.String code)
Deprecated.
Deprecated as of 2.7.0. See
migration guide..
|
java.lang.String |
toString()
Deprecated.
|
Http.Context |
withRequest(Http.Request request)
Deprecated.
Deprecated as of 2.7.0. See
migration guide..
|
@Deprecated public static java.lang.ThreadLocal<Http.Context> current
@Deprecated public java.util.Map<java.lang.String,java.lang.Object> args
public Context(Http.RequestBuilder requestBuilder, play.core.j.JavaContextComponents components)
requestBuilder
- the HTTP request builder.components
- the context components.public Context(Http.Request request, play.core.j.JavaContextComponents components)
request
- the HTTP requestcomponents
- the context components.public Context(java.lang.Long id, play.api.mvc.RequestHeader header, Http.Request request, java.util.Map<java.lang.String,java.lang.String> sessionData, java.util.Map<java.lang.String,java.lang.String> flashData, java.util.Map<java.lang.String,java.lang.Object> args, play.core.j.JavaContextComponents components)
id
- the unique context IDheader
- the request header (Not used anymore. You could simply pass null, it doesn't
matter)request
- the request with bodysessionData
- the session data extracted from the session cookieflashData
- the flash data extracted from the flash cookieargs
- any arbitrary data to associate with this request context.components
- the context components.public Context(java.lang.Long id, play.api.mvc.RequestHeader header, Http.Request request, java.util.Map<java.lang.String,java.lang.String> sessionData, java.util.Map<java.lang.String,java.lang.String> flashData, java.util.Map<java.lang.String,java.lang.Object> args, Lang lang, play.core.j.JavaContextComponents components)
id
- the unique context IDheader
- the request headerrequest
- the request with bodysessionData
- the session data extracted from the session cookieflashData
- the flash data extracted from the flash cookieargs
- any arbitrary data to associate with this request context.lang
- the transient lang to use.components
- the context components.public Context(java.lang.Long id, play.api.mvc.RequestHeader header, Http.Request request, Http.Response response, Http.Session session, Http.Flash flash, java.util.Map<java.lang.String,java.lang.Object> args, play.core.j.JavaContextComponents components)
#Context(Long, play.api.mvc.RequestHeader, Request, Response, Session,
Flash, Map, Lang, JavaContextComponents)
instead. Since 2.7.0.Use this constructor (or withRequest) to copy a context within a Java Action to be passed to a delegate.
id
- the unique context IDheader
- the request headerrequest
- the request with bodyresponse
- the response instance to usesession
- the session instance to useflash
- the flash instance to useargs
- any arbitrary data to associate with this request context.components
- the context components.public Context(java.lang.Long id, play.api.mvc.RequestHeader header, Http.Request request, Http.Response response, Http.Session session, Http.Flash flash, java.util.Map<java.lang.String,java.lang.Object> args, Lang lang, play.core.j.JavaContextComponents components)
Use this constructor (or withRequest) to copy a context within a Java Action to be passed to a delegate.
id
- the unique context IDheader
- the request header (Not used anymore. You could simply pass null, it doesn't
matter)request
- the request with bodyresponse
- the response instance to usesession
- the session instance to useflash
- the flash instance to useargs
- any arbitrary data to associate with this request context.lang
- the transient lang to use.components
- the context components.@Deprecated public static Http.Context current()
@Deprecated public static java.util.Optional<Http.Context> safeCurrent()
@Deprecated public static void setCurrent(Http.Context ctx)
@Deprecated public static void clear()
@Deprecated public java.lang.Long id()
Http.RequestHeader.id()
instead.@Deprecated public Http.Request request()
@Deprecated public Http.Response response()
Result
instead.@Deprecated public Http.Session session()
Http.RequestHeader.session()
and Result
instead.@Deprecated public Http.Flash flash()
Http.RequestHeader.flash()
and Result
instead.@Deprecated public play.api.mvc.RequestHeader _requestHeader()
request()
.asScala() instead. Since 2.7.0.@Deprecated public Lang lang()
@Deprecated public Messages messages()
@Deprecated public boolean changeLang(java.lang.String code)
MessagesApi.setLang(Result, Lang)
.code
- New lang code to use (e.g. "fr", "en-US", etc.)@Deprecated public boolean changeLang(Lang lang)
MessagesApi.setLang(Result, Lang)
.lang
- New Lang object to use@Deprecated public void clearLang()
MessagesApi.clearLang(Result)
.@Deprecated public void setTransientLang(java.lang.String code)
code
- the language code to set (e.g. "en-US")java.lang.IllegalArgumentException
- If the given language is not supported by the application.@Deprecated public void setTransientLang(Lang lang)
lang
- the language to setjava.lang.IllegalArgumentException
- If the given language is not supported by the application.@Deprecated public void clearTransientLang()
@Deprecated public FileMimeTypes fileMimeTypes()
FileMimeTypes
instead.public java.lang.String toString()
toString
in class java.lang.Object
@Deprecated public Http.Context withRequest(Http.Request request)
The id, session, flash and args remain unchanged.
This method is intended for use within a Java action, to create a new Context to pass to a delegate action.
request
- The request to create the new header from.