[
https://issues.apache.org/jira/browse/WW-3205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Lukasz Lenart updated WW-3205:
------------------------------
Fix Version/s: Future
Did you try to ask on the User ML ?
> Escaped apostrophe in property files
> ------------------------------------
>
> Key: WW-3205
> URL: https://issues.apache.org/jira/browse/WW-3205
> Project: Struts 2
> Issue Type: Bug
> Components: Other
> Affects Versions: 2.1.6
> Reporter: Tamas Ruff
> Fix For: Future
>
>
> My application contains both struts(1) and strust2 pages, and all the pages
> use the same property files as resource bundle. Some of the localized texts
> are used in javascript for both struts1 and struts2 pages. I have a problem
> with rendering the localized texts which contain apostrophes.
> For example I have the following "base" text: Vue d'ensemble de la page
> Because this localized text will be used in the JavaScript the result of
> rendering the tags should be:
> Vue d\'ensemble de la page
> (apostrophe escaped for javascript)
> In the strus1 jsp page (somewhere in a javascipt JSON table) I have:
> "<bean:message bundle='Struts2Resources' key='menu.item.home.tt'/>"
> To obtain the expected result for this tag in the property file I should have:
> 'menu.item.home.tt=Vue d\\'ensemble de la page
> Similarly in the strus2 jsp page (somewhere in a javascipt JSON table) I
> have:
> "<s:text name='menu.item.home.tt'/>"
> To obtain the expected result for this tag in the property file I should have:
> 'menu.item.home.tt=Vue d\\''ensemble de la page
> In the first case the result in the struts2 page will be
> Vue d\ensemble de la page
> i.e. the apostrophe disappear
> In the second case the result in the struts1 page will be
> Vue d\''ensemble de la page
> which result in javascript error.
> I don't really understand why is the behavior different for these tags
> because I suppose that at the background both use the same JDK
> ResourceBundles. Please suggest an escaping solution which should work for
> both struts1 and struts2 tags.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira