net.sourceforge.stripes.action
Class ErrorResolution

java.lang.Object
  extended by net.sourceforge.stripes.action.ErrorResolution
All Implemented Interfaces:
Resolution

public class ErrorResolution
extends Object
implements Resolution

Resolution for sending HTTP error messages back to the client. errorCode is the HTTP status code to be sent. errorMessage is a descriptive message.

Since:
Stripes 1.5
Author:
Aaron Porter

Constructor Summary
ErrorResolution(int errorCode)
          Sends an error response to the client using the specified status code and clears the buffer.
ErrorResolution(int errorCode, String errorMessage)
          Sends an error response to the client using the specified status code and message and clears the buffer.
 
Method Summary
 void execute(HttpServletRequest request, HttpServletResponse response)
          Called by the Stripes dispatcher to invoke the Resolution.
 int getErrorCode()
          Accessor for the HTTP status code.
 String getErrorMessage()
          Accessor for the descriptive error message.
 void setErrorCode(int errorCode)
          Setter for the HTTP status code.
 void setErrorMessage(String errorMessage)
          Setter for the descriptive error message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorResolution

public ErrorResolution(int errorCode)
Sends an error response to the client using the specified status code and clears the buffer.

Parameters:
errorCode - the HTTP status code

ErrorResolution

public ErrorResolution(int errorCode,
                       String errorMessage)
Sends an error response to the client using the specified status code and message and clears the buffer.

Parameters:
errorCode - the HTTP status code
errorMessage - a descriptive message
Method Detail

execute

public void execute(HttpServletRequest request,
                    HttpServletResponse response)
             throws Exception
Description copied from interface: Resolution
Called by the Stripes dispatcher to invoke the Resolution. Should use the request and response provided to direct the user to an appropriate view.

Specified by:
execute in interface Resolution
Parameters:
request - the current HttpServletRequest
response - the current HttpServletResponse
Throws:
Exception - exceptions of any type may be thrown if the Resolution cannot be executed as intended

getErrorCode

public int getErrorCode()
Accessor for the HTTP status code.


setErrorCode

public void setErrorCode(int errorCode)
Setter for the HTTP status code.


getErrorMessage

public String getErrorMessage()
Accessor for the descriptive error message.


setErrorMessage

public void setErrorMessage(String errorMessage)
Setter for the descriptive error message.



? Copyright 2005-2006, Stripes Development Team.