Bug 39431 - Optionally enable auto-escaping of single quotes for message tags
Summary: Optionally enable auto-escaping of single quotes for message tags
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.0.6
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2006-04-27 16:23 UTC by Alexei Yudichev
Modified: 2006-12-13 16:06 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Alexei Yudichev 2006-04-27 16:23:10 UTC
The problem was originally described in bug 30297. In short, <fmt:message> tag
does not escape single quotes before passing message text to MessageFormat. This
perfectly conforms to the specification, however there are two practical
problems with this:
1) message text should either escape single quotes or leave them depending on
whether it uses parameters - increased possibility of human error: need to
always match these two factors.
2) migration from Struts <bean:message> to <fmt:message> - natural for many
organisations - requires going through all messages and escaping quotes in those
that have parameters. And what if the migration should go gradually and there is
a possibility that same message is used both by <fmt> and <bean> tags? Then
there is no neat solution.

Can you add a configurable escaping of apostrophe sign to
org.apache.taglibs.standard.tag.common.fmt.MessageSupport class? I.e. escaping
would be triggered by context parameter or system property or whatever else?
Comment 1 Henri Yandell 2006-12-13 16:06:55 UTC
I've reported this to the 1.2 RI:


We'll be looking to the spec and 1.2 RI for a change here.