Spring MVC + Tiles: <!-- comments --> not rendering

I am using Spring MVC 3.1.x with Tiles 2.2.2 (bootstrapped project with Roo) and trying to create a view with a tiles template like:

<html   xmlns:jsp="http://java.sun.com/JSP/Page" 
    xmlns:c="http://java.sun.com/jsp/jstl/core" 
    xmlns:tiles="http://tiles.apache.org/tags-tiles" 
    xmlns:spring="http://www.springframework.org/tags" 
    xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" >

<jsp:output doctype-root-element="HTML" doctype-system="about:legacy-compat" />
<jsp:directive.page contentType="text/html;charset=UTF-8" />
<jsp:directive.page pageEncoding="UTF-8" />
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />    

    <util:load-scripts />

    <spring:message code="application_name" var="app_name" htmlEscape="false"/>
    <title><spring:message code="welcome_h3" arguments="${app_name}" /></title>
</head>
<body>
    <!--Comments -->
    <!--[if IE]>
        something
    <![endif]-->
    ...
    <tiles:insertAttribute name="menu" ignore="true" />
    ...
</body>
</html>

The Tiles attributes are working well, but neither the comments nor the conditional CSS are rendering; they just are not present in the output code.

Any ideas to render this "html comment element" code?

Answers


Solution: Jspx files and conditional comments

In summary, comments in jsp documents are ignored. The solution is:

<jsp:text><![CDATA[<!--[if lte IE 9]>]]></jsp:text>
...
<jsp:text><![CDATA[<![endif]-->]]></jsp:text>

Try to use jsp comments <%-- comment --%>. Hope this helps you. Cheers.


Need Your Help

MySQL - Decimal cannot be NULL

php mysql

Everytime I try to make an insert statement into my dastabase I get a "Incorrect decimal value: 'NULL' for column 'bounty3' at row 1" error. How do I insert a null value into a decimal datatype? ...

Debugging instance of another thread altering my data

c++ c visual-studio-2008 multithreading debugging

I have a huge global array of structures. Some regions of the array are tied to individual threads and those threads can modify their regions of the array without having to use critical sections. But