Search code examples
javaeclipsejspjstlstruts-1

Eclipse warnings: fmt:formatDate and html:hidden must be empty


I am doing some manipulations with date. It works fine. But eclipse shows warnings such as <fmt:formatDate> and <html:hidden> must be empty. I tried rewriting this constructions but nothing changes. I use these libraries.

The following is my code:

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<c:set var="date_str">    
    <fmt:formatDate value="${myForm.itemShop.date}">
        <jsp:attribute name="pattern">
            <bean:message key="date.pattern" />
        </jsp:attribute>
    </fmt:formatDate>
</c:set>

<html:hidden property="datePattern">
    <jsp:attribute name="value">
        <bean:message key="date.pattern" />
    </jsp:attribute>
</html:hidden>

Solution

  • The warnings are due to the TLD which specifies <body-content>empty<body-content> for the tag formatDate.

    This means that the body-content should be empty for the formatDate tag. Here is the documentation link for this tag.

    I think you can safely ignore these warnings.