info.magnolia.cms.servlets
Class MVCServletHandlerImpl

java.lang.Object
  extended by info.magnolia.cms.servlets.MVCServletHandlerImpl
All Implemented Interfaces:
MVCServletHandler
Direct Known Subclasses:
CommandBasedMVCServletHandler, DialogMVCHandler

public abstract class MVCServletHandlerImpl
extends java.lang.Object
implements MVCServletHandler

Default implementation of a MVCHandler. Calls the command (method) through reflection.

Version:
$Id: MVCServletHandlerImpl.java 41137 2011-01-06 18:19:25Z gjoseph $
Author:
Philipp Bracher

Field Summary
protected  java.lang.Throwable exception
           
protected  javax.servlet.http.HttpServletRequest request
           
protected  javax.servlet.http.HttpServletResponse response
           
protected static java.lang.String VIEW_ERROR
           
protected static java.lang.String VIEW_SUCCESS
           
 
Fields inherited from interface info.magnolia.cms.servlets.MVCServletHandler
VIEW_NOTHING
 
Constructor Summary
protected MVCServletHandlerImpl(java.lang.String name, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Method Summary
 java.lang.String execute(java.lang.String command)
          Call the method through reflection.
 java.lang.String getCommand()
          Returns the name of the command we want to execute.
 java.lang.Throwable getException()
          Getter for exception.
 java.lang.String getExceptionStackTrace()
          Returns the stacktrace from the exception as a String.
 java.lang.String getName()
          The name of the handler.
 javax.servlet.http.HttpServletRequest getRequest()
           
 javax.servlet.http.HttpServletResponse getResponse()
           
 void init()
          Called after instantiating.
protected  void populateFromRequest(java.lang.Object bean)
           
 void setCommand(java.lang.String command)
           
 void setRequest(javax.servlet.http.HttpServletRequest request)
           
 void setResponse(javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.magnolia.cms.servlets.MVCServletHandler
renderHtml
 

Field Detail

VIEW_ERROR

protected static final java.lang.String VIEW_ERROR
See Also:
Constant Field Values

VIEW_SUCCESS

protected static final java.lang.String VIEW_SUCCESS
See Also:
Constant Field Values

request

protected javax.servlet.http.HttpServletRequest request

response

protected javax.servlet.http.HttpServletResponse response

exception

protected java.lang.Throwable exception
Constructor Detail

MVCServletHandlerImpl

protected MVCServletHandlerImpl(java.lang.String name,
                                javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
Method Detail

init

public void init()
Description copied from interface: MVCServletHandler
Called after instantiating.

Specified by:
init in interface MVCServletHandler

populateFromRequest

protected void populateFromRequest(java.lang.Object bean)

getName

public java.lang.String getName()
Description copied from interface: MVCServletHandler
The name of the handler.

Specified by:
getName in interface MVCServletHandler
See Also:
MVCServletHandler.getName()

execute

public java.lang.String execute(java.lang.String command)
Call the method through reflection.

Specified by:
execute in interface MVCServletHandler
Returns:
the name of the view to show (used in renderHtml)

setRequest

public void setRequest(javax.servlet.http.HttpServletRequest request)
Parameters:
request - The request to set.

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Returns:
Returns the request.

setResponse

public void setResponse(javax.servlet.http.HttpServletResponse response)
Parameters:
response - The response to set.

getResponse

public javax.servlet.http.HttpServletResponse getResponse()
Returns:
Returns the response.

getCommand

public java.lang.String getCommand()
Description copied from interface: MVCServletHandler
Returns the name of the command we want to execute.

Specified by:
getCommand in interface MVCServletHandler
Returns:
Returns the command.

setCommand

public void setCommand(java.lang.String command)
Parameters:
command - The command to set.

getException

public java.lang.Throwable getException()
Getter for exception.

Returns:
Returns the exception.

getExceptionStackTrace

public java.lang.String getExceptionStackTrace()
Returns the stacktrace from the exception as a String.



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