Package general.common
Class RequestScope
- java.lang.Object
-
- general.common.RequestScope
-
public class RequestScope extends java.lang.ObjectProvides something similar to a request scope in Spring or Guice. Objects are stored within Play's Http.Context which is created anew for each request. It's a very useful storage that lasts just for the current request. You can e.g. store a StudyRequest that you retrieved from the database and reuse it later on without having to retrieve it from the database again. This saves resources and brings performance.
-
-
Constructor Summary
Constructors Constructor Description RequestScope()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Objectget(java.lang.String key)static booleanhas(java.lang.String key)static voidput(java.lang.String key, java.lang.Object value)Stores the given key-value pair in the request scope.
-
-
-
Method Detail
-
get
public static java.lang.Object get(java.lang.String key)
-
has
public static boolean has(java.lang.String key)
-
put
public static void put(java.lang.String key, java.lang.Object value)Stores the given key-value pair in the request scope. If it's already stored it gets overwritten.
-
-