<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
  <jsp:output omit-xml-declaration="yes" />

  <jsp:directive.attribute name="id" type="java.lang.String" required="true" description="The identifier for this tag (do not change!)" />
  <jsp:directive.attribute name="field" type="java.lang.String" required="true" description="The field exposed from the form backing object" />
  <jsp:directive.attribute name="label" type="java.lang.String" required="false" description="The label used for this field, will default to a message bundle if not supplied" />
  <jsp:directive.attribute name="disableFormBinding" type="java.lang.Boolean" required="false" description="Set to true to disable Spring form binding" />
  <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" />
  <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" />

  <c:if test="${empty render or render}">
    <c:if test="${empty sec_label}">
      <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" />
    </c:if>
    <c:set var="sec_field">
      <spring:escapeBody javaScriptEscape="true">${field}</spring:escapeBody>
    </c:set>
   
    <div id="_${sec_id}_id">
      <label for="_${sec_field}_id">
        <c:out value="${fn:escapeXml(label)}" />:
      </label>
      <c:choose>
        <c:when test="${disableFormBinding}">
          <input id="_${sec_field}_id" name="${sec_field}" type="checkbox" value="true" />
        </c:when>
        <c:otherwise>
          <form:checkbox id="_${sec_field}_id" path="${sec_field}" />
        </c:otherwise>
      </c:choose>
      <script type="text/javascript">
        Spring.addDecoration(new Spring.ElementDecoration({elementId : '_${sec_field}_id', widgetType : 'dijit.form.CheckBox'})); 
      </script>
    </div>
    <br />
  </c:if>
</jsp:root>