aspose file tools*
The moose likes Struts and the fly likes html:messages prints mystery characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:messages prints mystery characters" Watch "html:messages prints mystery characters" New topic
Author

html:messages prints mystery characters

Suzanne Israel
Greenhorn

Joined: Aug 23, 2002
Posts: 11
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
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi

in which locale are u running that page is it english r different .........ok can u try this once .place a initialisation paramter in ur web.xml
<init-param>
<param-name>null</param-name>
<param-value>false</param-value>
</init-param>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: html:messages prints mystery characters
 
Similar Threads
Re, Handling Error using ActionMessages
html:messages
Cannot display ActionMessages
ActionMessages?????????
Handling Messages (v1.2.9)