|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.nucleus.TimedOperationService atg.nucleus.servlet.ServletService atg.nucleus.servlet.HttpServletService atg.servlet.DynamoServlet atg.droplet.ForEach atg.droplet.ErrorMessageForEach
public class ErrorMessageForEach
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 |
---|
ARRAY, COUNT, DEBUG, ELEMENT, ELEMENT_NAME, EMPTY, INDEX, INDEX_NAME, KEY, OUTPUT, OUTPUT_END, OUTPUT_START, REVERSE_ORDER, SIZE, SORT_PROPERTIES |
Fields inherited from class atg.servlet.DynamoServlet |
---|
mAllowCleanupRequest, mParameters |
Fields inherited from class atg.nucleus.servlet.ServletService |
---|
SERVLET_INFO_KEY |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
ErrorMessageForEach()
|
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.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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
Constructor Detail |
---|
public ErrorMessageForEach()
Method Detail |
---|
public void setResourceName(java.lang.String pResourceName)
public java.lang.String getResourceName()
public void setMessageTable(java.util.Properties pMessageTable)
public java.util.Properties getMessageTable()
public void setPropertyNameTable(java.util.Properties pPropertyNameTable)
public java.util.Properties getPropertyNameTable()
public java.lang.Object getArray(DynamoHttpServletRequest pReq)
getArray
in class ForEach
protected void setElementParameter(DynamoHttpServletRequest pReq, java.lang.String pElementName, java.lang.Object pValue)
setElementParameter
in class ForEach
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |