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:
- Serializable, Servlet, ServletConfig
public class GroovyPagesServlet
- extends FrameworkServlet
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.
- Author:
- Troy Heninger, Graeme Rocher
Date: Jan 10, 2004
- See Also:
- Serialized Form
Methods inherited from class org.springframework.web.servlet.FrameworkServlet |
buildLocaleContext, createWebApplicationContext, createWebApplicationContext, destroy, doDelete, doGet, doOptions, doPost, doPut, doTrace, findWebApplicationContext, getContextAttribute, getContextClass, getContextConfigLocation, getNamespace, getServletContextAttributeName, getUsernameForRequest, getWebApplicationContext, initServletBean, initWebApplicationContext, onApplicationEvent, onRefresh, postProcessWebApplicationContext, processRequest, refresh, setContextAttribute, setContextClass, setContextConfigLocation, setDispatchOptionsRequest, setDispatchTraceRequest, setNamespace, setPublishContext, setPublishEvents, setThreadContextInheritable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EXCEPTION_MODEL_KEY
public static final String EXCEPTION_MODEL_KEY
- See Also:
- Constant Field Values
SERVLET_INSTANCE
public static final String SERVLET_INSTANCE
- See Also:
- Constant Field Values
GroovyPagesServlet
public GroovyPagesServlet()
initFrameworkServlet
protected void initFrameworkServlet()
throws ServletException,
BeansException
- Overrides:
initFrameworkServlet
in class FrameworkServlet
- Throws:
ServletException
BeansException
doService
protected void doService(HttpServletRequest request,
HttpServletResponse response)
throws Exception
- Specified by:
doService
in class FrameworkServlet
- Throws:
Exception
renderPageWithEngine
protected void renderPageWithEngine(GroovyPagesTemplateEngine engine,
HttpServletRequest request,
HttpServletResponse response,
groovy.text.Template template)
throws IOException,
ServletException
- Attempts to render the page with the given arguments
- Parameters:
engine
- The GroovyPagesTemplateEngine to userequest
- The HttpServletRequestresponse
- The HttpServletResponsetemplate
- The template
- Throws:
IOException
- Thrown when an I/O exception occurs rendering the page
ServletException
- Thrown when an exception occurs in the servlet environment
handleException
protected void handleException(HttpServletRequest request,
HttpServletResponse response,
Exception exception,
Writer out,
GroovyPagesTemplateEngine engine)
throws ServletException,
IOException
- Performs exception handling by attempting to render the Errors view
- Parameters:
request
- response
- exception
- The exception that occuredout
- The Writerengine
- The GSP engine @throws IOException Thrown when an I/O exception occurs rendering the page
- Throws:
ServletException
- Thrown when an exception occurs in the servlet environment
IOException
createResponseWriter
protected Writer createResponseWriter(HttpServletResponse response)
- Creates a response writer for the given response object
- Parameters:
response
- The HttpServletResponse
- Returns:
- The created java.io.Writer
Copyright (c) 2005-2009 The Grails project