org.nanocontainer.nanowar.nanoweb
Class NanoWebServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.nanocontainer.nanowar.nanoweb.NanoWebServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, KeyConstants

public class NanoWebServlet
extends javax.servlet.http.HttpServlet
implements KeyConstants

Dispatcher servlet for NanoWeb. NanoWeb is an ultra simple MVC framework inspired from WebWork It is based on ScriptedContainerBuilderFactory, PicoContainer, Ognl, Groovy and Velocity. Design goals:

Other things:

Version:
$Revision: 2528 $
Author:
Aslak Hellesøy, Kouhei Mori
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.nanocontainer.nanowar.KeyConstants
ACTIONS_CONTAINER, APPLICATION_CONTAINER, BUILDER, CONTAINER_COMPOSER, CONTAINER_COMPOSER_CONFIGURATION, KILLER_HELPER, NANOCONTAINER_PREFIX, REQUEST_CONTAINER, SESSION_CONTAINER
 
Constructor Summary
NanoWebServlet()
           
 
Method Summary
protected  void handleServiceScriptException(ScriptException e, javax.servlet.http.HttpServletResponse httpServletResponse, javax.servlet.http.HttpServletRequest httpServletRequest)
          This overridable method contains the default behavior for the catching of ScriptException during the service call.
 void init()
           
protected  void service(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NanoWebServlet

public NanoWebServlet()
Method Detail

init

public void init()
          throws javax.servlet.ServletException
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

service

protected void service(javax.servlet.http.HttpServletRequest httpServletRequest,
                       javax.servlet.http.HttpServletResponse httpServletResponse)
                throws javax.servlet.ServletException,
                       IOException
Overrides:
service in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

handleServiceScriptException

protected void handleServiceScriptException(ScriptException e,
                                            javax.servlet.http.HttpServletResponse httpServletResponse,
                                            javax.servlet.http.HttpServletRequest httpServletRequest)
                                     throws IOException
This overridable method contains the default behavior for the catching of ScriptException during the service call. Because different containers suck at handling exceptions, this default behavior displays a simple page. Teams deploying NanoWebServlet may want to extend and replace this functionality. This servlet may be participating with some larger model-2 design.

Parameters:
e - the script exception
httpServletResponse - the servlet response
httpServletRequest - the servlet request
Throws:
IOException - if for some bizarre reason the outgoing page cannot be written to.


Copyright © 2003-2009 Codehaus. All Rights Reserved.