You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by bu...@apache.org on 2004/03/23 00:35:32 UTC
DO NOT REPLY [Bug 27864] New: -
Need ability to easily escape message text for display in javascript, xml or html
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27864>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=27864
Need ability to easily escape message text for display in javascript, xml or html
Summary: Need ability to easily escape message text for display
in javascript, xml or html
Product: Taglibs
Version: 1.0
Platform: All
OS/Version: All
Status: NEW
Severity: Enhancement
Priority: Other
Component: I18N Taglib
AssignedTo: taglibs-dev@jakarta.apache.org
ReportedBy: igor@fedulov.com
Often it's needed to display a error message from i18n bundle in a javascript
alert box. Using following :
...
alert("<i18n:message="someErrorMessageText"/>");
...
is not a good idea because some languages contain special characters that needs
to be escaped, or may contain "new line" character which will render above
javascript statement as a error. There is a solution that exists right now:
...
alert("<%=SomeUtility.escapeString(messageBundleId.getString("someErrorMessageText"))%>");
...
That looks cumbersome and not clean. Suggestion is to use something like this:
...
alert("<i18n:message key="someErrorMessageText" outputType="js"/>");
...
that will automatically render output message in proper format removing the need
to escape it manually.
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org