com.cc.framework.adapter.struts
Class RequestProcessorUtil

java.lang.Object
  extended bycom.cc.framework.adapter.struts.RequestProcessorUtil

public abstract class RequestProcessorUtil
extends java.lang.Object

Utilities for RequestProcessor derived classes

Version:
$Revision: 1.1 $
Author:
Harald Schulz

Field Summary
private static org.apache.commons.logging.Log log
          Commons Logging instance.
 
Constructor Summary
RequestProcessorUtil()
           
 
Method Summary
static void assertRoles(java.lang.String roles, Principal principal)
          This method checks if the current principal has the required permission.
static java.lang.String getForwardURL(java.lang.String url)
          Workaround for problems with WAS4.0
static void postProcessPopulate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping)
           Populate the properties of the specified ActionForm instance from the request parameters included with this request.
static void preProcessPopulate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping)
           Populate the properties of the specified ActionForm instance from the request parameters included with this request.
static org.apache.struts.action.ActionForward processAction(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.Action action, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping)
          Ask the specified Action instance to handle this request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log
Commons Logging instance.

Constructor Detail

RequestProcessorUtil

public RequestProcessorUtil()
Method Detail

processAction

public static org.apache.struts.action.ActionForward processAction(javax.servlet.http.HttpServletRequest request,
                                                                   javax.servlet.http.HttpServletResponse response,
                                                                   org.apache.struts.action.Action action,
                                                                   org.apache.struts.action.ActionForm form,
                                                                   org.apache.struts.action.ActionMapping mapping)
                                                            throws java.lang.Exception
Ask the specified Action instance to handle this request. Return the ActionForward instance (if any) returned by the called Action for further processing.

Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
action - The Action instance to be used
form - The ActionForm instance to pass to this Action
mapping - The ActionMapping instance to pass to this Action
Returns:
ActionForward or null
Throws:
java.lang.Exception - if an error occurs

preProcessPopulate

public static void preProcessPopulate(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response,
                                      org.apache.struts.action.ActionForm form,
                                      org.apache.struts.action.ActionMapping mapping)
                               throws javax.servlet.ServletException

Populate the properties of the specified ActionForm instance from the request parameters included with this request. In addition, request attribute Globals.CANCEL_KEY will be set if the request was submitted with a button created by CancelTag.

Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
form - The ActionForm instance we are populating
mapping - The ActionMapping we are using
Throws:
javax.servlet.ServletException - if thrown by RequestUtils.populate()

postProcessPopulate

public static void postProcessPopulate(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response,
                                       org.apache.struts.action.ActionForm form,
                                       org.apache.struts.action.ActionMapping mapping)
                                throws javax.servlet.ServletException

Populate the properties of the specified ActionForm instance from the request parameters included with this request. In addition, request attribute Globals.CANCEL_KEY will be set if the request was submitted with a button created by CancelTag.

Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
form - The ActionForm instance we are populating
mapping - The ActionMapping we are using
Throws:
javax.servlet.ServletException - if thrown by RequestUtils.populate()

assertRoles

public static void assertRoles(java.lang.String roles,
                               Principal principal)
                        throws PermissionException
This method checks if the current principal has the required permission. the method will only return if the if the principal has the required permissions.

Parameters:
roles - required roles for this action
principal - the current principal
Throws:
PermissionException - is thrown if the users permissions are insufficient

getForwardURL

public static java.lang.String getForwardURL(java.lang.String url)
Workaround for problems with WAS4.0

Parameters:
url - Die URL
Returns:
Forward


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.