Jsp judges the List Length
Hello everyone:
One problem encountered today is that the back-end uploads a List to the front-end and the front-end judges the List length!
Other tags are required to search for other users.
In jsp development, it is often necessary to determine the length of the list or string to do something. Because if in the jstl label does not support else, select while. <% @ Taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %> <% @ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %> -------- standard is required here. the jar package introduces two tag libraries to determine the length, for example, Jsp code
Not grouped
$ {Tags. tagname}
What I want to talk about today is just the tag <% @ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>.
You only need to add an implicit tag to the body to easily determine
So OK !!!
-
Traditional Chinese medicine:
-
$ {TcMedicineList. name }$ {tcMedicineList. standard}
Dose: $ {ptcMedicineList. num }$ {ptcMedicineList. unit}
<% -- Dose: $ {ptcMedicineList. dosage}
-- %> Usage: $ {ptcMedicineList. usemethod }$ {ptcMedicineList. dosage}
>
Dose: $ {ptcMedicineList. num }$ {ptcMedicineList. unit}
Usage: $ {ptcMedicineList. usemethod }$ {ptcMedicineList. dosage} expand
$ {TcMedicineList. name }$ {tcMedicineList. standard}
Dose: $ {ptcMedicineList. num }$ {ptcMedicineList. unit}
Usage: $ {ptcMedicineList. usemethod }$ {ptcMedicineList. dosage} collapse
Western medicines:
$ {WeMedicineList. name }$ {weMedicineList. standard}
... Expand
$ {WeMedicineList. name }$ {weMedicineList. standard}
Collapse
<% --
Check items:
$ {Entity. name}
Expand
$ {Entity. name}
Collapse
-- %>
Others:
$ {OtMedicineList. name }$ {otMedicineList. standard}
Treatment items:
$ {TrMedicineList. name }$ {trMedicineList. standard}
Total: $ {RMB} yuan