[
https://issues.apache.org/struts/browse/WW-2555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45116#action_45116
]
Mathias Bogaert commented on WW-2555:
-------------------------------------
This breaks the build, since the XWork snapshot has not been published.
> Add javaScriptEscape attribute to propertyTag
> ---------------------------------------------
>
> Key: WW-2555
> URL: https://issues.apache.org/struts/browse/WW-2555
> Project: Struts 2
> Issue Type: New Feature
> Components: Plugin - Tags
> Affects Versions: 2.0.11.1, 2.1.0
> Reporter: Jelmer Kuperus
> Fix For: 2.1.3
>
> Attachments: struts.patch, xwork.patch
>
>
> Currently if you want to use a property value in a piece of javascript you
> have to take care of escaping special characters such as \r \n \t , single
> quotes etc yourself. Otherwise you might end up with unclosed string literals
> etc. The way we solved this in out application is to wrap the output of a
> struts property within the body of another tag that does the escaping. eg:
> alert('<lib:javaScriptEscape><s:property
> value="myProperty"/></lib:javaScriptEscape>');
> This works well but is somewhat verbose. It would be very convenient if
> s:property would have a javaScriptEscape attribute to acomplish the same
> task. eg :
> alert('<s:property value="myProperty" javaScriptEscape="true" />');
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.