0

In many tags of spring.tld there are those attributes: htmlEscape javaScriptEscape

The question may seem trivial, but which is the difference from html escape and javascript escape in this context?

gipinani
  • 14,038
  • 12
  • 56
  • 85

1 Answers1

1

Well the htmlEscape is use to escape literal within the html document. like for example, if the html document contains special characters, it will be escaped as follows:

Original : <    >    "      &
Escaped  : &lt; &gt; &quot; &amp;

Javascript escape will apply across javascript literal. Suppose I have the literal:

<script>
    function helloWorld(){
        alert('<html:message javaScriptEscape="true" code="hello" />')
    }
<script>

Applying a javascript will escape the single and double quotes, the newline chars, the tabs, etc.

Ashish
  • 510
  • 3
  • 14