@SuppressWarnings(['CompileStatic']) //FIXME there is a bug in the codenarc ext that looks at new LocaleContext() as a class @Log4j @CompileStatic class GrailsWebEnvironment extends Object
based on the RenderEnvironment in grails-rendering and private class in grails-mail All this does is bind a mock request and mock response is one doesn't exist deals with setting the WrappedResponseHolder.wrappedResponse as well
Type | Name and description |
---|---|
ApplicationContext |
applicationContext |
Locale |
locale |
Writer |
out |
Constructor and description |
---|
GrailsWebEnvironment
(ApplicationContext applicationContext, Writer out, Locale locale = null) |
Type Params | Return Type | Name and description |
---|---|---|
|
static GrailsWebRequest |
bindMockWebRequest(ApplicationContext appCtx, Writer wout, Locale preferredLocale = null) |
|
static GrailsWebRequest |
bindRequestIfNull() |
|
static GrailsWebRequest |
bindRequestIfNull(ApplicationContext appCtx) |
|
static GrailsWebRequest |
bindRequestIfNull(ApplicationContext appCtx, Writer out, Locale preferredLocale = null) |
|
void |
close() |
|
String |
getControllerName() |
|
void |
initCopy() |
|
static void |
withNew(ApplicationContext applicationContext, Writer out, Closure block) Establish an environment inheriting the locale of the current request if there is one |
|
static void |
withNew(ApplicationContext applicationContext, Writer out, Locale locale, Closure block) Establish an environment with a specific locale |
Establish an environment inheriting the locale of the current request if there is one
Establish an environment with a specific locale
Groovy Documentation