Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.grails.plugins.web.api
[Java] Class CommonWebApi

    java.lang.Object
      org.codehaus.groovy.grails.plugins.web.api.CommonWebApi

All Implemented Interfaces:
  GrailsApplicationAware, org.springframework.web.context.ServletContextAware, org.springframework.context.ApplicationContextAware, java.io.Serializable

    public class CommonWebApi
    extends java.lang.Object

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

Authors:
  Graeme Rocher

Since:
  2.0

Field Summary
`static java.lang.String` | `RAW_CODEC_NAME`

Constructor Summary
`CommonWebApi(GrailsPluginManager pluginManager)`
`CommonWebApi()`

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
`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
`java.lang.Object` | `raw(java.lang.Object instance, java.lang.Object value)` Marks the given value to be output in raw form without encoding
`void` | `setApplicationContext(org.springframework.context.ApplicationContext applicationContext)`
`void` | `setGrailsApplication(GrailsApplication grailsApplication)`
`void` | `setServletContext(javax.servlet.ServletContext servletContext)`

Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Field Detail

### RAW_CODEC_NAME

    public static final java.lang.String RAW_CODEC_NAME

Constructor Detail

### CommonWebApi

    public CommonWebApi(GrailsPluginManager pluginManager)

### CommonWebApi

    public CommonWebApi()

Method Detail

### currentRequestAttributes

    protected GrailsWebRequest currentRequestAttributes()

### getActionName

    public java.lang.String getActionName(java.lang.Object instance)

  Obtains the currently executing action name
  Returns:
    The action name

### getApplicationContext

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

  Obtains the ApplicationContext instance
  Returns:
    The ApplicationContext instance

### getControllerName

    public java.lang.String getControllerName(java.lang.Object instance)

  Obtains the currently executing controller name
  Returns:
    The controller name

### getFlash

    public FlashScope getFlash(java.lang.Object instance)

  Obtains the Grails FlashScope instance
  Returns:
    The FlashScope instance

### getGrailsApplication

    public GrailsApplication getGrailsApplication(java.lang.Object instance)

  Obtains the GrailsApplication instance
  Returns:
    The GrailsApplication instance

### getGrailsAttributes

    public GrailsApplicationAttributes getGrailsAttributes(java.lang.Object instance)

  Obtains the GrailsApplicationAttributes instance
  Returns:
    The GrailsApplicationAttributes instance

### getParams

    public GrailsParameterMap getParams(java.lang.Object instance)

  Obtains the Grails parameter map
  Returns:
    The GrailsParameterMap 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

### getRequest

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

  Obtains the HttpServletRequest instance
  Returns:
    The HttpServletRequest instance

### getResponse

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

  Obtains the HttpServletResponse instance
  Returns:
    The HttpServletResponse instance

### getServletContext

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

  Obtains the ServletContext instance
  Returns:
    The ServletContext instance

### getSession

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

  Obtains the HttpSession instance
  Returns:
    The HttpSession instance

### getWebRequest

    public GrailsWebRequest getWebRequest(java.lang.Object instance)

  Obtains the currently executing web request
  Returns:
    The GrailsWebRequest instance

### raw

    public java.lang.Object raw(java.lang.Object instance, java.lang.Object value)

  Marks the given value to be output in raw form without encoding
  Parameters:
    `instance` - The instance
    `value` - The value
  Returns:
    The raw unencoded value
  Since:
    2.3

### setApplicationContext

    public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)

### setGrailsApplication

    public void setGrailsApplication(GrailsApplication grailsApplication)

### setServletContext

    public void setServletContext(javax.servlet.ServletContext servletContext)

Groovy Documentation