• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

html:messages prints mystery characters

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic