info.magnolia.cms.servlets
Class MVCServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by info.magnolia.cms.servlets.MVCServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
AdminTreeMVCServlet, DialogMVCServlet, PageMVCServlet

public abstract class MVCServlet
extends javax.servlet.http.HttpServlet

The servlet gets a MVCServletHandler with the method getHandler(HttpServletRequest, HttpServletResponse). MVCServletHandler.getCommand() is called and the returned command name is passed to the MVCServletHandler.execute(String) method wich returns the view name. Finally it calls MVCServletHandler.renderHtml(String) passing the view name.

Make a subclass to provide you own handler(s).

Version:
$Id: MVCServlet.java 41137 2011-01-06 18:19:25Z gjoseph $
See Also:
Serialized Form

Constructor Summary
MVCServlet()
           
 
Method Summary
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected abstract  MVCServletHandler getHandler(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
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, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MVCServlet

public MVCServlet()
Method Detail

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException
See Also:
HttpServlet.doGet(HttpServletRequest,HttpServletResponse)

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      IOException
Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException
See Also:
HttpServlet.doPost(HttpServletRequest, HttpServletResponse)

getHandler

protected abstract MVCServletHandler getHandler(javax.servlet.http.HttpServletRequest request,
                                                javax.servlet.http.HttpServletResponse response)
Parameters:
request -
Returns:


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.