String footer = null;
String prefix = null;
String suffix = null;
Locale locale = getLocale(request, session);
MessageResources resources =
getMessageResources(request, application, bundle);
if (resources != null)
{
header = resources.getMessage(locale, "errors.header");
footer = resources.getMessage(locale, "errors.footer");
prefix = resources.getMessage(locale, "errors.prefix");
suffix = resources.getMessage(locale, "errors.suffix");
}
if (header == null)
{
header = "errors.header";
}
if (footer == null)
{
footer = "errors.footer";
}
/* prefix or suffix are optional, be quiet if they're missing */
if (prefix == null)
{
prefix = "";
}
if (suffix == null)
{
suffix = "";
}
results.append(header);
results.append("\r\n");
String message;
while (reports.hasNext())
{
message = null;
ActionMessage report = (ActionMessage)reports.next();
if (resources != null) //&& report.isResource() DOTCMS-4819
{
message = resources.getMessage(locale,
report.getKey(),
report.getValues());
}
results.append(prefix);