How to use Javascript script tag in Facelets xhtml file

If you want to use javascript, with the <script> tag in Facelets xhtml file, and your script have characters like ‘>’, ‘<’, you may get this error message:

com.sun.facelets.FaceletException: Error Parsing /filename.xhtml: Error Traced[line: xx]
The content of elements must consist of well-formed character data or markup.

To avoid this parsing error use the script in a "commented" way:

<script type="text/javascript">
<!--
your script here.
//-->
</script>
About these ads