org.codehaus.groovy.grails.web.pages
Class GroovyPagesServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.springframework.web.servlet.HttpServletBean
org.springframework.web.servlet.FrameworkServlet
org.codehaus.groovy.grails.web.pages.GroovyPagesServlet
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, org.codehaus.groovy.grails.plugins.PluginManagerAware, org.springframework.beans.factory.Aware, org.springframework.context.EnvironmentAware
public class GroovyPagesServlet
- extends org.springframework.web.servlet.FrameworkServlet
- implements org.codehaus.groovy.grails.plugins.PluginManagerAware
NOTE: Based on work done by on the GSP standalone project (https://gsp.dev.java.net/)
Main servlet class. Example usage in web.xml:
GroovyPagesServlet
org.codehaus.groovy.grails.web.pages.GroovyPagesServlet
showSource
1
Allows developers to view the intermediade source code, when they pass
a showSource argument in the URL (eg /edit/list?showSource=true.
- See Also:
- Serialized Form
|
Field Summary |
static java.lang.String |
SERVLET_INSTANCE
The size of the buffer used when formulating the response |
| Fields inherited from class org.springframework.web.servlet.FrameworkServlet |
DEFAULT_CONTEXT_CLASS, DEFAULT_NAMESPACE_SUFFIX, SERVLET_CONTEXT_PREFIX |
| Fields inherited from class org.springframework.web.servlet.HttpServletBean |
logger |
| Methods inherited from class org.springframework.web.servlet.FrameworkServlet |
applyInitializers, buildLocaleContext, configureAndRefreshWebApplicationContext, createWebApplicationContext, createWebApplicationContext, destroy, doDelete, doGet, doOptions, doPost, doPut, doTrace, findWebApplicationContext, getContextAttribute, getContextClass, getContextConfigLocation, getContextId, getNamespace, getServletContextAttributeName, getUsernameForRequest, getWebApplicationContext, initServletBean, initWebApplicationContext, onApplicationEvent, onRefresh, postProcessWebApplicationContext, processRequest, refresh, setContextAttribute, setContextClass, setContextConfigLocation, setContextId, setContextInitializerClasses, setContextInitializers, setDispatchOptionsRequest, setDispatchTraceRequest, setNamespace, setPublishContext, setPublishEvents, setThreadContextInheritable |
| Methods inherited from class org.springframework.web.servlet.HttpServletBean |
addRequiredProperty, getServletContext, getServletName, init, initBeanWrapper, setEnvironment |
| Methods inherited from class javax.servlet.http.HttpServlet |
doHead, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SERVLET_INSTANCE
public static final java.lang.String SERVLET_INSTANCE
- The size of the buffer used when formulating the response
- See Also:
- Constant Field Values
GroovyPagesServlet
public GroovyPagesServlet()
initFrameworkServlet
protected void initFrameworkServlet()
throws javax.servlet.ServletException,
org.springframework.beans.BeansException
- Overrides:
initFrameworkServlet in class org.springframework.web.servlet.FrameworkServlet
- Throws:
javax.servlet.ServletException
org.springframework.beans.BeansException
setGroovyPagesTemplateEngine
public void setGroovyPagesTemplateEngine(GroovyPagesTemplateEngine groovyPagesTemplateEngine)
doService
protected void doService(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.lang.Exception
- Specified by:
doService in class org.springframework.web.servlet.FrameworkServlet
- Throws:
java.lang.Exception
getGroovyPagesTemplateEngine
public GroovyPagesTemplateEngine getGroovyPagesTemplateEngine()
isSecurePath
protected boolean isSecurePath(java.lang.String pageName)
sendNotFound
protected void sendNotFound(javax.servlet.http.HttpServletResponse response,
java.lang.String pageName)
throws java.io.IOException
- Throws:
java.io.IOException
findPageInBinaryPlugins
protected GroovyPageScriptSource findPageInBinaryPlugins(java.lang.String pageName)
renderPageWithEngine
protected void renderPageWithEngine(GroovyPagesTemplateEngine engine,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
GroovyPageScriptSource scriptSource)
throws java.lang.Exception
- Attempts to render the page with the given arguments
- Parameters:
engine - The GroovyPagesTemplateEngine to userequest - The HttpServletRequestresponse - The HttpServletResponsescriptSource - The template
- Throws:
java.io.IOException - Thrown when an I/O exception occurs rendering the page
java.lang.Exception
createResponseWriter
protected GSPResponseWriter createResponseWriter(javax.servlet.http.HttpServletResponse response)
- Creates a response writer for the given response object
- Parameters:
response - The HttpServletResponse
- Returns:
- The created java.io.Writer
setPluginManager
public void setPluginManager(org.codehaus.groovy.grails.plugins.GrailsPluginManager pluginManager)
- Specified by:
setPluginManager in interface org.codehaus.groovy.grails.plugins.PluginManagerAware