org.codehaus.groovy.grails.plugins.web.api
Class CommonWebApi

java.lang.Object
  extended by org.codehaus.groovy.grails.plugins.web.api.CommonWebApi
All Implemented Interfaces:
java.io.Serializable, org.codehaus.groovy.grails.plugins.support.aware.GrailsApplicationAware, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware

public class CommonWebApi
extends java.lang.Object
implements org.codehaus.groovy.grails.plugins.support.aware.GrailsApplicationAware, org.springframework.web.context.ServletContextAware, org.springframework.context.ApplicationContextAware, java.io.Serializable

API shared by controllers, tag libraries and any other web artifact.

Since:
2.0
See Also:
Serialized Form

Constructor Summary
CommonWebApi()
           
CommonWebApi(org.codehaus.groovy.grails.plugins.GrailsPluginManager pluginManager)
           
 
Method Summary
protected  GrailsWebRequest currentRequestAttributes()
           
 java.lang.String getActionName(java.lang.Object instance)
          Obtains the currently executing action name
 org.springframework.context.ApplicationContext getApplicationContext(java.lang.Object instance)
          Obtains the ApplicationContext instance
 java.lang.String getControllerName(java.lang.Object instance)
          Obtains the currently executing controller name
 FlashScope getFlash(java.lang.Object instance)
          Obtains the Grails FlashScope instance
 org.codehaus.groovy.grails.commons.GrailsApplication getGrailsApplication(java.lang.Object instance)
          Obtains the GrailsApplication instance
 GrailsApplicationAttributes getGrailsAttributes(java.lang.Object instance)
          Obtains the GrailsApplicationAttributes instance
 GrailsParameterMap getParams(java.lang.Object instance)
          Obtains the Grails parameter map
 java.lang.String getPluginContextPath(java.lang.Object delegate)
          Obtains the pluginContextPath
 javax.servlet.http.HttpServletRequest getRequest(java.lang.Object instance)
          Obtains the HttpServletRequest instance
 javax.servlet.http.HttpServletResponse getResponse(java.lang.Object instance)
          Obtains the HttpServletResponse instance
 javax.servlet.ServletContext getServletContext(java.lang.Object instance)
          Obtains the ServletContext instance
 javax.servlet.http.HttpSession getSession(java.lang.Object instance)
          Obtains the HttpSession instance
 GrailsWebRequest getWebRequest(java.lang.Object instance)
          Obtains the currently executing web request
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setGrailsApplication(org.codehaus.groovy.grails.commons.GrailsApplication grailsApplication)
           
 void setServletContext(javax.servlet.ServletContext servletContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonWebApi

public CommonWebApi(org.codehaus.groovy.grails.plugins.GrailsPluginManager pluginManager)

CommonWebApi

public CommonWebApi()
Method Detail

getParams

public GrailsParameterMap getParams(java.lang.Object instance)
Obtains the Grails parameter map

Returns:
The GrailsParameterMap instance

getFlash

public FlashScope getFlash(java.lang.Object instance)
Obtains the Grails FlashScope instance

Returns:
The FlashScope instance

getSession

public javax.servlet.http.HttpSession getSession(java.lang.Object instance)
Obtains the HttpSession instance

Returns:
The HttpSession instance

getRequest

public javax.servlet.http.HttpServletRequest getRequest(java.lang.Object instance)
Obtains the HttpServletRequest instance

Returns:
The HttpServletRequest instance

getServletContext

public javax.servlet.ServletContext getServletContext(java.lang.Object instance)
Obtains the ServletContext instance

Returns:
The ServletContext instance

getResponse

public javax.servlet.http.HttpServletResponse getResponse(java.lang.Object instance)
Obtains the HttpServletResponse instance

Returns:
The HttpServletResponse instance

getGrailsAttributes

public GrailsApplicationAttributes getGrailsAttributes(java.lang.Object instance)
Obtains the GrailsApplicationAttributes instance

Returns:
The GrailsApplicationAttributes instance

getGrailsApplication

public org.codehaus.groovy.grails.commons.GrailsApplication getGrailsApplication(java.lang.Object instance)
Obtains the GrailsApplication instance

Returns:
The GrailsApplication instance

getApplicationContext

public org.springframework.context.ApplicationContext getApplicationContext(java.lang.Object instance)
Obtains the ApplicationContext instance

Returns:
The ApplicationContext instance

getActionName

public java.lang.String getActionName(java.lang.Object instance)
Obtains the currently executing action name

Returns:
The action name

getControllerName

public java.lang.String getControllerName(java.lang.Object instance)
Obtains the currently executing controller name

Returns:
The controller name

getWebRequest

public GrailsWebRequest getWebRequest(java.lang.Object instance)
Obtains the currently executing web request

Returns:
The GrailsWebRequest instance

getPluginContextPath

public java.lang.String getPluginContextPath(java.lang.Object delegate)
Obtains the pluginContextPath

Parameters:
delegate - The object the method is being invoked on
Returns:
The plugin context path

setGrailsApplication

public void setGrailsApplication(org.codehaus.groovy.grails.commons.GrailsApplication grailsApplication)
Specified by:
setGrailsApplication in interface org.codehaus.groovy.grails.plugins.support.aware.GrailsApplicationAware

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Specified by:
setServletContext in interface org.springframework.web.context.ServletContextAware

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

currentRequestAttributes

protected GrailsWebRequest currentRequestAttributes()