Package dev.voidframework.web.http
Class Context
java.lang.Object
dev.voidframework.web.http.Context
An http request context.
-
Constructor Summary
ConstructorsConstructorDescriptionContext(HttpRequest httpRequest, Session session, FlashMessages flashMessages, Locale locale) Build a new instance. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves context attributes.Retrieves the flash messages.Retrieves the locale.Retrieves the request.Retrieves the session.voidSets the locale.
-
Constructor Details
-
Context
public Context(HttpRequest httpRequest, Session session, FlashMessages flashMessages, Locale locale) Build a new instance.- Parameters:
httpRequest- The HTTP requestsession- The current sessionflashMessages- The current flash messagelocale- The current locale
-
-
Method Details
-
getAttributes
Retrieves context attributes.- Returns:
- The attributes
-
getRequest
Retrieves the request.- Returns:
- The current request
-
getSession
Retrieves the session.- Returns:
- The current session
-
getFlashMessages
Retrieves the flash messages.- Returns:
- The flash messages
-
getLocale
Retrieves the locale.- Returns:
- The current locale
-
setLocal
Sets the locale.- Parameters:
locale- The locale to use
-