Groovy Documentation

org.codehaus.groovy.grails.web.servlet
[Java] Interface GrailsApplicationAttributes

org.codehaus.groovy.grails.commons.ApplicationAttributes
  org.codehaus.groovy.grails.web.servlet.GrailsApplicationAttributes
All Superinterfaces:
ApplicationAttributes

public interface GrailsApplicationAttributes
extends ApplicationAttributes

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

Authors:
Graeme Rocher


Field Summary
java.lang.String ACTION_NAME_ATTRIBUTE

java.lang.String APP_URI_ATTRIBUTE

java.lang.String CONTENT_FORMAT

java.lang.String CONTROLLER

java.lang.String CONTROLLER_NAME_ATTRIBUTE

java.lang.String ERRORS

java.lang.String FLASH_SCOPE

java.lang.String GSP_TEMPLATE_ENGINE

java.lang.String GSP_TMP_WRITER

java.lang.String GSP_TO_RENDER

java.lang.String ID_PARAM

java.lang.String MODEL_AND_VIEW

java.lang.String OUT

java.lang.String PAGE_SCOPE

java.lang.String PARAMS_OBJECT

java.lang.String PATH_TO_VIEWS

java.lang.String PROPERTY_REGISTRY

java.lang.String RENDERING_ERROR_ATTRIBUTE

java.lang.String REQUEST_FORMATS

java.lang.String REQUEST_REDIRECTED_ATTRIBUTE

java.lang.String TAG_CACHE

java.lang.String WEB_REQUEST

 
Fields inherited from interface ApplicationAttributes
APPLICATION_CONTEXT, PARENT_APPLICATION_CONTEXT, PLUGIN_MANAGER, REQUEST_SCOPE_ID
 
Method Summary
java.lang.String getApplicationUri(ServletRequest request)

@param request

groovy.lang.GroovyObject getController(ServletRequest request)

@return The controller for the request

java.lang.String getControllerActionUri(ServletRequest request)

@param request

java.lang.String getControllerUri(ServletRequest request)

@param request

Errors getErrors(ServletRequest request)

@param request

FlashScope getFlashScope(ServletRequest request)

Retrieves the flash scope instance for the given requeste

GroovyPagesUriService getGroovyPagesUriService()

MessageSource getMessageSource()

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

java.io.Writer getOut(HttpServletRequest request)

Holds the current response write for the request

GroovyPagesTemplateEngine getPagesTemplateEngine()

@return Retrieves the shared GSP template engine

java.lang.String getPluginContextPath(HttpServletRequest request)

Retrieves the plugin context path for the current request.

ServletContext getServletContext()

Retrieves the servlet context instance

groovy.lang.GroovyObject getTagLibraryForTag(HttpServletRequest request, 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(HttpServletRequest request, 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(groovy.lang.GroovyObject controller, java.lang.String templateName)

java.lang.String getTemplateUri(java.lang.CharSequence templateName, ServletRequest request)

@param templateName

java.lang.String getViewUri(java.lang.String viewName, HttpServletRequest request)

Retrieves the uri of a named view

void setOut(HttpServletRequest currentRequest, java.io.Writer out2)

Sets the current write for the request

 
Methods inherited from interface ApplicationAttributes
getApplicationContext, getGrailsApplication
 

Field Detail

ACTION_NAME_ATTRIBUTE

public java.lang.String ACTION_NAME_ATTRIBUTE


APP_URI_ATTRIBUTE

public java.lang.String APP_URI_ATTRIBUTE


CONTENT_FORMAT

public java.lang.String CONTENT_FORMAT


CONTROLLER

public java.lang.String CONTROLLER


CONTROLLER_NAME_ATTRIBUTE

public java.lang.String CONTROLLER_NAME_ATTRIBUTE


ERRORS

public java.lang.String ERRORS


FLASH_SCOPE

public java.lang.String FLASH_SCOPE


GSP_TEMPLATE_ENGINE

public java.lang.String GSP_TEMPLATE_ENGINE


GSP_TMP_WRITER

public java.lang.String GSP_TMP_WRITER


GSP_TO_RENDER

public java.lang.String GSP_TO_RENDER


ID_PARAM

public java.lang.String ID_PARAM


MODEL_AND_VIEW

public java.lang.String MODEL_AND_VIEW


OUT

public java.lang.String OUT


PAGE_SCOPE

public java.lang.String PAGE_SCOPE


PARAMS_OBJECT

public java.lang.String PARAMS_OBJECT


PATH_TO_VIEWS

public java.lang.String PATH_TO_VIEWS


PROPERTY_REGISTRY

public java.lang.String PROPERTY_REGISTRY


RENDERING_ERROR_ATTRIBUTE

public java.lang.String RENDERING_ERROR_ATTRIBUTE


REQUEST_FORMATS

public java.lang.String REQUEST_FORMATS


REQUEST_REDIRECTED_ATTRIBUTE

public java.lang.String REQUEST_REDIRECTED_ATTRIBUTE


TAG_CACHE

public java.lang.String TAG_CACHE


WEB_REQUEST

public java.lang.String WEB_REQUEST


 
Method Detail

getApplicationUri

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


getController

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


getControllerActionUri

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


getControllerUri

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


getErrors

public Errors getErrors(ServletRequest request)
Parameters:
request
Returns:
The errors instance contained within the request


getFlashScope

public FlashScope getFlashScope(ServletRequest request)
Retrieves the flash scope instance for the given requeste
Parameters:
request
Returns:
The FlashScope instance


getGroovyPagesUriService

public GroovyPagesUriService getGroovyPagesUriService()


getMessageSource

public MessageSource getMessageSource()


getNoSuffixViewURI

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


getOut

public java.io.Writer getOut(HttpServletRequest request)
Holds the current response write for the request
Returns:
The held response writer


getPagesTemplateEngine

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


getPluginContextPath

public java.lang.String getPluginContextPath(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


getServletContext

public ServletContext getServletContext()
Retrieves the servlet context instance
Returns:
The servlet context instance


getTagLibraryForTag

public groovy.lang.GroovyObject getTagLibraryForTag(HttpServletRequest request, 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

public groovy.lang.GroovyObject getTagLibraryForTag(HttpServletRequest request, 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


getTemplateURI

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


getTemplateUri

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


getViewUri

public java.lang.String getViewUri(java.lang.String viewName, 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


setOut

public void setOut(HttpServletRequest currentRequest, java.io.Writer out2)
Sets the current write for the request
Parameters:
currentRequest - The request
out2 - The writer


 

Groovy Documentation