Class ErrorMessageForEach

  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.nucleus.servlet.ServletService
                  extended by atg.nucleus.servlet.HttpServletService
                      extended by atg.servlet.DynamoServlet
                          extended by atg.droplet.ForEach
                              extended by atg.droplet.ErrorMessageForEach
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, ParameterServlet, java.util.EventListener, javax.servlet.Servlet

public class ErrorMessageForEach
extends ForEach

The servlet takes a list of exceptions and renders the text of an error message for each exception, by translating the message and propertyName properties of the exception.

The list of exceptions can be specified as an input parameter in one of two ways. If you do not define a source for exceptions, the list of all exceptions that have occurred in this request is used.

Otherwise, you can specify a Vector of ServletException s as the exceptions parameter. For example, you'd add this parameter to the invocation of this servlet in a jhtml file:

     <param name="exceptions" value="bean:MyFormHandler.formExceptions">

The exceptions are translated into error messages using a pair of mapping tables. One keys off of the errorCode property of the exception, the other keys off of its propertyName. The tables supply specific errors to display for each exception that are likely to be encountered. If no entry is provided for a errorCode or a propertyName, the original message property in the exception is printed.

The mapping tables are created by taking the union of two different dictionaries. The default dictionary is defined with the propertyNameTable and messageTable bean properties of this servlet. The other dictionary is taken from a the propertyNameTable and messageTable request parameters passed to the servlet.

Each exception can either have an entry in the message table, the property name table or both. If both entries are present, the "message" table entry is displayed but it can use the sequence "param:propertyName" to substitute the contents of the "propertyName" table entry.

This servlet takes the same parameters as the servlet atg.droplet.ForEach to control how the exceptions are displayed. Each time that the output parameter is rendered, this servlet sets "message" and "propertyName" parameters which contain the translated values.

Note that propertyName is only associated with DropletFormExceptions - those exceptions that are generated in a failure to set the value of a bean property. For ServletExceptions, the propertyName entry is not set.

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
Fields inherited from class atg.droplet.ForEach
Fields inherited from class atg.servlet.DynamoServlet
mAllowCleanupRequest, mParameters
Fields inherited from class atg.nucleus.servlet.ServletService
Fields inherited from class atg.nucleus.GenericService
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
Constructor Summary
Method Summary
 java.lang.Object getArray(DynamoHttpServletRequest pReq)
          Returns the Vector of exceptions to display.
 java.util.Properties getMessageTable()
 java.util.Properties getPropertyNameTable()
 java.lang.String getResourceName()
protected  void setElementParameter(DynamoHttpServletRequest pReq, java.lang.String pElementName, java.lang.Object pValue)
          In this method, we extract the message and propertyName values that we want to render in the request first mapping them through the tables provided.
 void setMessageTable(java.util.Properties pMessageTable)
          Sets the property MessageTable.
 void setPropertyNameTable(java.util.Properties pPropertyNameTable)
          Sets the property PropertyNameTable.
 void setResourceName(java.lang.String pResourceName)
          Sets the property ResourceName.
Methods inherited from class atg.droplet.ForEach
getSortedArray, service, serviceArray, serviceCollection, serviceDictionary, serviceEnumeration, serviceIndexedList, serviceIterator, serviceMap, serviceMapArray, servicePrimitiveArray
Methods inherited from class atg.servlet.DynamoServlet
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, service, service, setParameter
Methods inherited from class atg.nucleus.servlet.ServletService
destroy, getServletConfig, getServletInfo, init, setServletInfo
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail


public ErrorMessageForEach()
Method Detail


public void setResourceName(java.lang.String pResourceName)
Sets the property ResourceName.


public java.lang.String getResourceName()
The value of the property ResourceName.


public void setMessageTable(java.util.Properties pMessageTable)
Sets the property MessageTable. This Properties object contains a translation from the message field of the exception to a text message to be displayed.


public java.util.Properties getMessageTable()
The value of the property MessageTable.


public void setPropertyNameTable(java.util.Properties pPropertyNameTable)
Sets the property PropertyNameTable. This Properties object defines a translation from the propertyName in a DropletFormException to the text description of that property as it is to be displayed to the user.


public java.util.Properties getPropertyNameTable()
The value of the property PropertyNameTable.


public java.lang.Object getArray(DynamoHttpServletRequest pReq)
Returns the Vector of exceptions to display.

getArray in class ForEach


protected void setElementParameter(DynamoHttpServletRequest pReq,
                                   java.lang.String pElementName,
                                   java.lang.Object pValue)
In this method, we extract the message and propertyName values that we want to render in the request first mapping them through the tables provided.

setElementParameter in class ForEach