Interface RequestContext<R extends RequestContext<?>>

All Known Subinterfaces:
AppRequestContext, AppRequestContext, AppRequestContext, DefaultRequestContext
All Known Implementing Classes:
AppRequestContextDefault, AppRequestContextDefault, AppRequestContextDefault, DefaultRequestContextDefault

public interface RequestContext<R extends RequestContext<?>>
The base interface for a request context. This declares the default add-ons and default utility methods.
  • Method Details

    • request

      Request related methods.
    • response

      Response related methods.
    • routing

      Routing related methods.
    • templating

      Templating methods.
    • variables

      Request scoped variables related methods.
    • cacheHeaders

      Cache headers related methods.
    • json

      JsonManager json()
      Easy access to the JsonManager, Json related methods.
    • xml

      XmlManager xml()
      Easy access to the XmlManager, XML related methods.
    • guice

      com.google.inject.Injector guice()
      Easy access to the Guice context.
    • get

      <T> T get(Class<T> clazz)
      Shortcut to get an instance from Guice. Will also cache the instance (as long as it is request scoped or a singleton).
    • get

      <T> T get(com.google.inject.Key<T> key)
      Shortcut to get an instance from Guice. Will also cache the instance (as long as it is request scoped or a singleton)
    • getLocaleToUse

      Locale getLocaleToUse()
      The best Locale to use, as resolved by the LocaleResolver.
    • getTimeZoneToUse

      TimeZone getTimeZoneToUse()
      The best TimeZone to use, as resolved by the TimeZoneResolver.
    • exchange

      Object exchange()
      The underlying exchange object, as given by the HTTP server. If you know for sure what its implementation is, you may cast it to access extra functionalities not provided by Spincast out of the box.