org.codehaus.groovy.grails.web.servlet.mvc
Interface GrailsControllerHelper

All Known Implementing Classes:
SimpleGrailsControllerHelper

public interface GrailsControllerHelper

An interface for a helper class that processes Grails controller requests and responses

Since:
0.2 Created: Oct 27, 2005
Author:
Graeme Rocher

Method Summary
 GrailsControllerClass getControllerClassByName(String className)
          Retrieves a controller class for the specified class name
 GrailsControllerClass getControllerClassByURI(String uri)
          Retrieves a GrailsControllerClass by URI
 groovy.lang.GroovyObject getControllerInstance(GrailsControllerClass controllerClass)
          Creates a new controller instance for the specified GrailsControllerClass
 GrailsApplicationAttributes getGrailsAttributes()
           
 ServletContext getServletContext()
           
 Object handleAction(groovy.lang.GroovyObject controller, groovy.lang.Closure action, HttpServletRequest request, HttpServletResponse response)
          Handles a Controller action
 Object handleAction(groovy.lang.GroovyObject controller, groovy.lang.Closure action, HttpServletRequest request, HttpServletResponse response, Map params)
          Handles a Controller action
 ModelAndView handleActionResponse(groovy.lang.GroovyObject controller, Object returnValue, String closurePropertyName, String viewName)
          Processes an action response for the specified arguments
 ModelAndView handleURI(String uri, GrailsWebRequest webRequest)
          Handles a Grails URI
 ModelAndView handleURI(String uri, GrailsWebRequest webRequest, Map params)
          Handles a Grails URI
 

Method Detail

getServletContext

ServletContext getServletContext()
Returns:
The servlet context instance

getControllerClassByName

GrailsControllerClass getControllerClassByName(String className)
Retrieves a controller class for the specified class name

Parameters:
className -
Returns:
The controller class or null

getControllerClassByURI

GrailsControllerClass getControllerClassByURI(String uri)
Retrieves a GrailsControllerClass by URI

Parameters:
uri - The URI to lookup
Returns:
A GrailsControllerClass

getControllerInstance

groovy.lang.GroovyObject getControllerInstance(GrailsControllerClass controllerClass)
Creates a new controller instance for the specified GrailsControllerClass

Parameters:
controllerClass - The GrailsControllerClass
Returns:
A new controller instance

handleURI

ModelAndView handleURI(String uri,
                       GrailsWebRequest webRequest)
Handles a Grails URI

Parameters:
uri - The URI to processs
webRequest - The GrailsWebRequest
Returns:
A ModelAndView instance

handleAction

Object handleAction(groovy.lang.GroovyObject controller,
                    groovy.lang.Closure action,
                    HttpServletRequest request,
                    HttpServletResponse response)
Handles a Controller action

Parameters:
action - An action Closure instance
request - The request object
response - The response
Returns:
The action response

handleAction

Object handleAction(groovy.lang.GroovyObject controller,
                    groovy.lang.Closure action,
                    HttpServletRequest request,
                    HttpServletResponse response,
                    Map params)
Handles a Controller action

Parameters:
action - An action Closure instance
request - The request object
response - The response
params - A Map of controller parameters
Returns:
The action response

handleActionResponse

ModelAndView handleActionResponse(groovy.lang.GroovyObject controller,
                                  Object returnValue,
                                  String closurePropertyName,
                                  String viewName)
Processes an action response for the specified arguments

Parameters:
controller - The controller instance
returnValue - The response from the closure
closurePropertyName - The property name of the closure
viewName - The name of the view
Returns:
A ModelAndView object

handleURI

ModelAndView handleURI(String uri,
                       GrailsWebRequest webRequest,
                       Map params)
Handles a Grails URI

Parameters:
uri - The URI to processs
webRequest - the GrailsWebRequest instance
params - A map of controller parameters
Returns:
A ModelAndView instance

getGrailsAttributes

GrailsApplicationAttributes getGrailsAttributes()
Returns:
Returns the grails request attributes instance


Copyright (c) 2005-2009 The Grails project