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 Object
implements MVCServletHandler

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

Version:
$Id$
Author:
Philipp Bracher

Field Summary
protected  Throwable exception
           
protected  javax.servlet.http.HttpServletRequest request
           
protected  javax.servlet.http.HttpServletResponse response
           
protected static String VIEW_ERROR
           
protected static String VIEW_SUCCESS
           
 
Fields inherited from interface info.magnolia.cms.servlets.MVCServletHandler
VIEW_NOTHING
 
Constructor Summary
protected MVCServletHandlerImpl(String name, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Method Summary
 String execute(String command)
          Call the method through reflection.
 String getCommand()
          Returns the name of the command we want to execute.
 Throwable getException()
          Getter for exception.
 String getExceptionStackTrace()
          Returns the stacktrace from the exception as a String.
 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(Object bean)
           
 void setCommand(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 String VIEW_ERROR
See Also:
Constant Field Values

VIEW_SUCCESS

protected static final String VIEW_SUCCESS
See Also:
Constant Field Values

request

protected javax.servlet.http.HttpServletRequest request

response

protected javax.servlet.http.HttpServletResponse response

exception

protected Throwable exception
Constructor Detail

MVCServletHandlerImpl

protected MVCServletHandlerImpl(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(Object bean)

getName

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

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

execute

public String execute(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 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(String command)
Parameters:
command - The command to set.

getException

public Throwable getException()
Getter for exception.

Returns:
Returns the exception.

getExceptionStackTrace

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



Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.