I have a
JSP page that displays any informational messages saved using the ActionMessages.GLOBAL_MESSAGE key.
The code itself works OK - the problem is that regardless of how I code the <html:messages> tag (and believe me I've tried multiple combinations), the message output always seems to include some question marks in the output, as shown in the generated HTML below:
<b>Informational Messages:</b><ul>
<li>???Values were successfully overridden.???</li>
</ul><br/>
If anybody can shed some light on what is causing these question marks to appear (and how I can get rid of them), I'd much appreciate it!
My deployment environment is:
Weblogic 6.1 (sp3) (
servlet api 2.3)
Struts 1.1
JDK 1.3.1
JSTL 1.1
Our standard page header sets the character encoding to:
<meta http-equiv="Content-Type" CONTENT="text/html; charset=iso-8859-1">
Relevant code extracts etc are shown below:
JSP:
<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<html:messages id="msg" message="true"
header="messages.header"
footer="messages.footer">
<li><fmt:message key="${msg}"/></li>
</html:messages>
MESSAGE RESOURCES:
messages.header=<b>Informational Messages:</b><ul>
messages.footer=</ul><br/>
messages.override.success=Values were successfully overridden.
JAVA:
ActionMessages msgs = new ActionMessages();
try {
// does stuff here
msgs.add(ActionMessages.GLOBAL_MESSAGE,
new ActionMessage("messages.override.success"));
} catch (Exception e) {
msgs.add(ActionErrors.GLOBAL_ERROR,
new ActionError("error.generic.message"));
}
saveMessages(request, msgs);
return mapping.findForward("success");
Hopefully,
Suzanne Israel