Interface GrailsApplicationAttributes

  • All Superinterfaces:
    grails.core.ApplicationAttributes
    All Known Implementing Classes:
    DefaultGrailsApplicationAttributes

    public interface GrailsApplicationAttributes
    extends grails.core.ApplicationAttributes
    Defines the names of and methods to retrieve Grails specific request and servlet attributes.
    • 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

        @Deprecated
        java.lang.String getApplicationUri​(javax.servlet.ServletRequest request)
        Deprecated.
        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)
        Resolve the URI for a template
        Parameters:
        controller - The controller
        templateName - The name of the template
        Returns:
        The template name
      • getTemplateURI

        java.lang.String getTemplateURI​(groovy.lang.GroovyObject controller,
                                        java.lang.String templateName,
                                        boolean includeExtension)
        Resolve the URI for a template
        Parameters:
        controller - The controller
        templateName - The name of the template
        includeExtension - Whether to include the GSP etension
        Returns:
        The template name
      • 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

        org.grails.gsp.ResourceAwareTemplateEngine getPagesTemplateEngine()
        Returns:
        Retrieves the shared GSP template engine
      • 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()
        Returns:
        The GroovyPageUriService instance
      • getMessageSource

        org.springframework.context.MessageSource getMessageSource()
        Returns:
        The MessageSource instance