/src/main/webapp/WEB-INF/tags/form/fields/simple.tagx

https://bitbucket.org/zzha4573/readertest · Unknown · 35 lines · 31 code · 4 blank · 0 comment · 0 complexity · 5e9bb0f199e85f424c4b3cc7329c2b81 MD5 · raw file

  1. <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">
  2. <jsp:output omit-xml-declaration="yes" />
  3. <jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" />
  4. <jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" />
  5. <jsp:directive.attribute name="text" type="java.lang.String" required="false" rtexprvalue="true" description="The text to be presented" />
  6. <jsp:directive.attribute name="messageCode" type="java.lang.String" required="false" rtexprvalue="true" description="The code for the message to be presented" />
  7. <jsp:directive.attribute name="messageCodeAttribute" type="java.lang.String" required="false" rtexprvalue="true" description="The attribute for the message code sto be presented" />
  8. <jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" />
  9. <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" />
  10. <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)" />
  11. <c:if test="${empty render or render}">
  12. <c:if test="${empty label}">
  13. <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" htmlEscape="false" />
  14. </c:if>
  15. <div id="_${fn:escapeXml(id)}_id">
  16. <label for="_${fn:escapeXml(field)}_id">
  17. <c:out value="${label}" />
  18. :
  19. </label>
  20. <c:choose>
  21. <c:when test="${not empty messageCode}">
  22. <spring:message code="${messageCode}" arguments="${messageCodeAttribute}" />
  23. </c:when>
  24. <c:otherwise>
  25. <spring:eval expression="text" />
  26. </c:otherwise>
  27. </c:choose>
  28. </div>
  29. <br />
  30. </c:if>
  31. </jsp:root>