|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet org.codehaus.groovy.grails.web.pages.GroovyPagesServlet
public class GroovyPagesServlet
NOTE: Based on work done by on the GSP standalone project (https://gsp.dev.java.net/)
Main servlet class. Example usage in web.xml:
Field Summary | |
---|---|
static String |
EXCEPTION_MODEL_KEY
|
Constructor Summary | |
---|---|
GroovyPagesServlet()
|
Method Summary | |
---|---|
protected Writer |
createResponseWriter(HttpServletResponse response)
Creates a response writer for the given response object |
void |
doGet(HttpServletRequest request,
HttpServletResponse response)
|
void |
doPage(HttpServletRequest request,
HttpServletResponse response)
Execute page and produce output. |
void |
doPost(HttpServletRequest request,
HttpServletResponse response)
|
ServletContext |
getServletContext()
|
protected void |
handleException(Exception exception,
Writer out,
GroovyPagesTemplateEngine engine)
Performs exception handling by attempting to render the Errors view |
void |
init(ServletConfig config)
Initialize the servlet, set it's parameters. |
protected void |
renderPageWithEngine(GroovyPagesTemplateEngine engine,
HttpServletRequest request,
HttpServletResponse response,
Resource pageResource)
Attempts to render the page with the given arguments |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String EXCEPTION_MODEL_KEY
Constructor Detail |
---|
public GroovyPagesServlet()
Method Detail |
---|
public void init(ServletConfig config)
init
in interface Servlet
init
in class GenericServlet
config
- servlet settingspublic void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
doGet
in class HttpServlet
ServletException
IOException
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
doPost
in class HttpServlet
ServletException
IOException
public ServletContext getServletContext()
getServletContext
in interface ServletConfig
getServletContext
in class GenericServlet
public void doPage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
request
- The HttpServletRequest insanceresponse
- The HttpServletResponse instance
ServletException
- Thrown when an exception occurs executing the servlet
IOException
- Thrown when an IOException occurs executing the servletprotected void renderPageWithEngine(GroovyPagesTemplateEngine engine, HttpServletRequest request, HttpServletResponse response, Resource pageResource) throws IOException, ServletException
engine
- The GroovyPagesTemplateEngine to userequest
- The HttpServletRequestresponse
- The HttpServletResponsepageResource
- The URL of the page
IOException
- Thrown when an I/O exception occurs rendering the page
ServletException
- Thrown when an exception occurs in the servlet environmentprotected void handleException(Exception exception, Writer out, GroovyPagesTemplateEngine engine) throws ServletException, IOException
exception
- The exception that occuredout
- The Writerengine
- The GSP engine
IOException
- Thrown when an I/O exception occurs rendering the page
ServletException
- Thrown when an exception occurs in the servlet environmentprotected Writer createResponseWriter(HttpServletResponse response)
response
- The HttpServletResponse
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |