org.codehaus.groovy.grails.web.servlet
Interface GrailsApplicationAttributes

All Superinterfaces:
org.codehaus.groovy.grails.commons.ApplicationAttributes
All Known Implementing Classes:
DefaultGrailsApplicationAttributes

public interface GrailsApplicationAttributes
extends org.codehaus.groovy.grails.commons.ApplicationAttributes

Defines the names of and methods to retrieve Grails specific request and servlet attributes.


Field Summary
static java.lang.String ACTION_NAME_ATTRIBUTE
           
static java.lang.String APP_URI_ATTRIBUTE
           
static java.lang.String ASYNC_STARTED
           
static java.lang.String CONTENT_FORMAT
           
static java.lang.String CONTROLLER
           
static java.lang.String CONTROLLER_NAME_ATTRIBUTE
           
static java.lang.String ERRORS
           
static java.lang.String FLASH_SCOPE
           
static java.lang.String GRAILS_CONTROLLER_CLASS
           
static java.lang.String GSP_CODEC
           
static java.lang.String GSP_TEMPLATE_ENGINE
           
static java.lang.String GSP_TMP_WRITER
           
static java.lang.String GSP_TO_RENDER
           
static java.lang.String ID_PARAM
           
static java.lang.String MODEL_AND_VIEW
           
static java.lang.String OUT
           
static java.lang.String PAGE_SCOPE
           
static java.lang.String PARAMS_OBJECT
           
static java.lang.String PATH_TO_VIEWS
           
static java.lang.String PROPERTY_REGISTRY
           
static java.lang.String REDIRECT_ISSUED
           
static java.lang.String RENDERING_ERROR_ATTRIBUTE
           
static java.lang.String REQUEST_FORMATS
           
static java.lang.String REQUEST_REDIRECTED_ATTRIBUTE
           
static java.lang.String RESPONSE_FORMAT
           
static java.lang.String RESPONSE_FORMATS
           
static java.lang.String TAG_CACHE
           
static java.lang.String TEMPLATE_MODEL
           
static java.lang.String WEB_REQUEST
           
 
Fields inherited from interface org.codehaus.groovy.grails.commons.ApplicationAttributes
APPLICATION_CONTEXT, PARENT_APPLICATION_CONTEXT, PLUGIN_MANAGER, REQUEST_SCOPE_ID
 
Method Summary
 java.lang.String getApplicationUri(javax.servlet.ServletRequest request)
           
 groovy.lang.GroovyObject getController(javax.servlet.ServletRequest request)
           
 java.lang.String getControllerActionUri(javax.servlet.ServletRequest request)
           
 java.lang.String getControllerUri(javax.servlet.ServletRequest request)
           
 org.springframework.validation.Errors getErrors(javax.servlet.ServletRequest request)
           
 FlashScope getFlashScope(javax.servlet.ServletRequest request)
          Retrieves the flash scope instance for the given requeste
 GroovyPagesUriService getGroovyPagesUriService()
           
 org.springframework.context.MessageSource getMessageSource()
           
 java.lang.String getNoSuffixViewURI(groovy.lang.GroovyObject controller, java.lang.String viewName)
           
 java.io.Writer getOut(javax.servlet.http.HttpServletRequest request)
          Holds the current response write for the request
 GroovyPagesTemplateEngine getPagesTemplateEngine()
           
 java.lang.String getPluginContextPath(javax.servlet.http.HttpServletRequest request)
          Retrieves the plugin context path for the current request.
 javax.servlet.ServletContext getServletContext()
          Retrieves the servlet context instance
 groovy.lang.GroovyObject getTagLibraryForTag(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String tagName)
          Retrieves a Grails tag library from the request for the named tag in the default namespace GroovyPage.DEFAULT_NAMESPACE
 groovy.lang.GroovyObject getTagLibraryForTag(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String tagName, java.lang.String namespace)
          Retrieves a Grails tag library from the request for the named tag in a given namespace.
 java.lang.String getTemplateUri(java.lang.CharSequence templateName, javax.servlet.ServletRequest request)
           
 java.lang.String getTemplateURI(groovy.lang.GroovyObject controller, java.lang.String templateName)
           
 java.lang.String getViewUri(java.lang.String viewName, javax.servlet.http.HttpServletRequest request)
          Retrieves the uri of a named view
 void setOut(javax.servlet.http.HttpServletRequest currentRequest, java.io.Writer out2)
          Sets the current write for the request
 
Methods inherited from interface org.codehaus.groovy.grails.commons.ApplicationAttributes
getApplicationContext, getGrailsApplication
 

Field Detail

PATH_TO_VIEWS

static final java.lang.String PATH_TO_VIEWS
See Also:
Constant Field Values

GSP_TEMPLATE_ENGINE

static final java.lang.String GSP_TEMPLATE_ENGINE
See Also:
Constant Field Values

ASYNC_STARTED

static final java.lang.String ASYNC_STARTED
See Also:
Constant Field Values

CONTENT_FORMAT

static final java.lang.String CONTENT_FORMAT
See Also:
Constant Field Values

RESPONSE_FORMAT

static final java.lang.String RESPONSE_FORMAT
See Also:
Constant Field Values

REQUEST_FORMATS

static final java.lang.String REQUEST_FORMATS
See Also:
Constant Field Values

RESPONSE_FORMATS

static final java.lang.String RESPONSE_FORMATS
See Also:
Constant Field Values

FLASH_SCOPE

static final java.lang.String FLASH_SCOPE
See Also:
Constant Field Values

PARAMS_OBJECT

static final java.lang.String PARAMS_OBJECT
See Also:
Constant Field Values

CONTROLLER

static final java.lang.String CONTROLLER
See Also:
Constant Field Values

PROPERTY_REGISTRY

static final java.lang.String PROPERTY_REGISTRY
See Also:
Constant Field Values

ERRORS

static final java.lang.String ERRORS
See Also:
Constant Field Values

MODEL_AND_VIEW

static final java.lang.String MODEL_AND_VIEW
See Also:
Constant Field Values

TEMPLATE_MODEL

static final java.lang.String TEMPLATE_MODEL
See Also:
Constant Field Values

OUT

static final java.lang.String OUT
See Also:
Constant Field Values

TAG_CACHE

static final java.lang.String TAG_CACHE
See Also:
Constant Field Values

ID_PARAM

static final java.lang.String ID_PARAM
See Also:
Constant Field Values

GSP_TO_RENDER

static final java.lang.String GSP_TO_RENDER
See Also:
Constant Field Values

GSP_CODEC

static final java.lang.String GSP_CODEC
See Also:
Constant Field Values

WEB_REQUEST

static final java.lang.String WEB_REQUEST
See Also:
Constant Field Values

PAGE_SCOPE

static final java.lang.String PAGE_SCOPE
See Also:
Constant Field Values

GSP_TMP_WRITER

static final java.lang.String GSP_TMP_WRITER
See Also:
Constant Field Values

REQUEST_REDIRECTED_ATTRIBUTE

static final java.lang.String REQUEST_REDIRECTED_ATTRIBUTE
See Also:
Constant Field Values

ACTION_NAME_ATTRIBUTE

static final java.lang.String ACTION_NAME_ATTRIBUTE
See Also:
Constant Field Values

CONTROLLER_NAME_ATTRIBUTE

static final java.lang.String CONTROLLER_NAME_ATTRIBUTE
See Also:
Constant Field Values

GRAILS_CONTROLLER_CLASS

static final java.lang.String GRAILS_CONTROLLER_CLASS
See Also:
Constant Field Values

APP_URI_ATTRIBUTE

static final java.lang.String APP_URI_ATTRIBUTE
See Also:
Constant Field Values

RENDERING_ERROR_ATTRIBUTE

static final java.lang.String RENDERING_ERROR_ATTRIBUTE
See Also:
Constant Field Values

REDIRECT_ISSUED

static final java.lang.String REDIRECT_ISSUED
See Also:
Constant Field Values
Method Detail

getPluginContextPath

java.lang.String getPluginContextPath(javax.servlet.http.HttpServletRequest request)
Retrieves the plugin context path for the current request. The plugin context path is the path used by plugins to reference resources such as javascript, CSS and so forth It is established by evaluating the current controller, if the current controller is plugin provided then it will attempt to evaluate the path based on the plugin the controller came from

Returns:
The plugin context path

getController

groovy.lang.GroovyObject getController(javax.servlet.ServletRequest request)
Returns:
The controller for the request

getControllerUri

java.lang.String getControllerUri(javax.servlet.ServletRequest request)
Parameters:
request -
Returns:
The uri of the controller within the request

getApplicationUri

java.lang.String getApplicationUri(javax.servlet.ServletRequest request)
Parameters:
request -
Returns:
The uri of the application relative to the server root

getTemplateURI

java.lang.String getTemplateURI(groovy.lang.GroovyObject controller,
                                java.lang.String templateName)

getNoSuffixViewURI

java.lang.String getNoSuffixViewURI(groovy.lang.GroovyObject controller,
                                    java.lang.String viewName)

getServletContext

javax.servlet.ServletContext getServletContext()
Retrieves the servlet context instance

Returns:
The servlet context instance

getFlashScope

FlashScope getFlashScope(javax.servlet.ServletRequest request)
Retrieves the flash scope instance for the given requeste

Parameters:
request -
Returns:
The FlashScope instance

getTemplateUri

java.lang.String getTemplateUri(java.lang.CharSequence templateName,
                                javax.servlet.ServletRequest request)
Parameters:
templateName -
request -
Returns:
The uri of a named template for the current controller

getViewUri

java.lang.String getViewUri(java.lang.String viewName,
                            javax.servlet.http.HttpServletRequest request)
Retrieves the uri of a named view

Parameters:
viewName - The name of the view
request - The request instance
Returns:
The name of the view

getControllerActionUri

java.lang.String getControllerActionUri(javax.servlet.ServletRequest request)
Parameters:
request -
Returns:
The uri of the action called within the controller

getErrors

org.springframework.validation.Errors getErrors(javax.servlet.ServletRequest request)
Parameters:
request -
Returns:
The errors instance contained within the request

getPagesTemplateEngine

GroovyPagesTemplateEngine getPagesTemplateEngine()
Returns:
Retrieves the shared GSP template engine

getTagLibraryForTag

groovy.lang.GroovyObject getTagLibraryForTag(javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response,
                                             java.lang.String tagName)
Retrieves a Grails tag library from the request for the named tag in the default namespace GroovyPage.DEFAULT_NAMESPACE

Parameters:
request - the request instance
response - the response instancte
tagName - The name of the tag that contains the tag library
Returns:
An instance of the tag library or null if not found

getTagLibraryForTag

groovy.lang.GroovyObject getTagLibraryForTag(javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response,
                                             java.lang.String tagName,
                                             java.lang.String namespace)
Retrieves a Grails tag library from the request for the named tag in a given namespace.

Parameters:
request - the request instance
response - the response instancte
tagName - The name of the tag that contains the tag library
namespace - The namespace of the tag
Returns:
An instance of the tag library or null if not found

getOut

java.io.Writer getOut(javax.servlet.http.HttpServletRequest request)
Holds the current response write for the request

Returns:
The held response writer

setOut

void setOut(javax.servlet.http.HttpServletRequest currentRequest,
            java.io.Writer out2)
Sets the current write for the request

Parameters:
currentRequest - The request
out2 - The writer

getGroovyPagesUriService

GroovyPagesUriService getGroovyPagesUriService()

getMessageSource

org.springframework.context.MessageSource getMessageSource()