views:

25

answers:

1

Hello!

I am using Spring Roo for my project. Spring Roo is using JSPX for round-tripping.

How do I embed JavaScript in JSPX page, so it stays parsable?

+1  A: 

Use CDATA and javascript comment.

<script type="text/javascript">
// <![CDATA[
    alert(1);
// ]]>
</script>

This will tell to XML parser that content inside <script> tag is ok.

Topera