转自:https://blog.csdn.net/mygzs/article/details/52668248

#dates

  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Dates
  4. * ======================================================================
  5. */
  6. /*
  7. * Format date with the standard locale format
  8. * Also works with arrays, lists or sets
  9. */
  10. ${#dates.format(date)}
  11. ${#dates.arrayFormat(datesArray)}
  12. ${#dates.listFormat(datesList)}
  13. ${#dates.setFormat(datesSet)}
  14. /*
  15. * Format date with the ISO8601 format
  16. * Also works with arrays, lists or sets
  17. */
  18. ${#dates.formatISO(date)}
  19. ${#dates.arrayFormatISO(datesArray)}
  20. ${#dates.listFormatISO(datesList)}
  21. ${#dates.setFormatISO(datesSet)}
  22. /*
  23. * Format date with the specified pattern
  24. * Also works with arrays, lists or sets
  25. */
  26. ${#dates.format(date, 'dd/MMM/yyyy HH:mm')}
  27. ${#dates.arrayFormat(datesArray, 'dd/MMM/yyyy HH:mm')}
  28. ${#dates.listFormat(datesList, 'dd/MMM/yyyy HH:mm')}
  29. ${#dates.setFormat(datesSet, 'dd/MMM/yyyy HH:mm')}
  30. /*
  31. * Obtain date properties
  32. * Also works with arrays, lists or sets
  33. */
  34. ${#dates.day(date)} // also arrayDay(...), listDay(...), etc.
  35. ${#dates.month(date)} // also arrayMonth(...), listMonth(...), etc.
  36. ${#dates.monthName(date)} // also arrayMonthName(...), listMonthName(...), etc.
  37. ${#dates.monthNameShort(date)} // also arrayMonthNameShort(...), listMonthNameShort(...), etc.
  38. ${#dates.year(date)} // also arrayYear(...), listYear(...), etc.
  39. ${#dates.dayOfWeek(date)} // also arrayDayOfWeek(...), listDayOfWeek(...), etc.
  40. ${#dates.dayOfWeekName(date)} // also arrayDayOfWeekName(...), listDayOfWeekName(...), etc.
  41. ${#dates.dayOfWeekNameShort(date)} // also arrayDayOfWeekNameShort(...), listDayOfWeekNameShort(...), etc.
  42. ${#dates.hour(date)} // also arrayHour(...), listHour(...), etc.
  43. ${#dates.minute(date)} // also arrayMinute(...), listMinute(...), etc.
  44. ${#dates.second(date)} // also arraySecond(...), listSecond(...), etc.
  45. ${#dates.millisecond(date)} // also arrayMillisecond(...), listMillisecond(...), etc.
  46. /*
  47. * Create date (java.util.Date) objects from its components
  48. */
  49. ${#dates.create(year,month,day)}
  50. ${#dates.create(year,month,day,hour,minute)}
  51. ${#dates.create(year,month,day,hour,minute,second)}
  52. ${#dates.create(year,month,day,hour,minute,second)}
  53. ${#dates.create(year,month,day,hour,minute,second,millisecond)}
  54. /*
  55. * Create a date (java.util.Date) object for the current date and time
  56. */
  57. ${#dates.createNow()}
  58. /*
  59. * Create a date (java.util.Date) object for the current date (time set to 00:00)
  60. */
  61. ${#dates.createToday()}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61

#Calendars:

  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Calendars
  4. * ======================================================================
  5. */
  6. /*
  7. * Format calendar with the standard locale format
  8. * Also works with arrays, lists or sets
  9. */
  10. ${#calendars.format(cal)}
  11. ${#calendars.arrayFormat(calArray)}
  12. ${#calendars.listFormat(calList)}
  13. ${#calendars.setFormat(calSet)}
  14. /*
  15. * Format calendar with the ISO8601 format
  16. * Also works with arrays, lists or sets
  17. */
  18. ${#calendars.formatISO(cal)}
  19. ${#calendars.arrayFormatISO(calArray)}
  20. ${#calendars.listFormatISO(calList)}
  21. ${#calendars.setFormatISO(calSet)}
  22. /*
  23. * Format calendar with the specified pattern
  24. * Also works with arrays, lists or sets
  25. */
  26. ${#calendars.format(cal, 'dd/MMM/yyyy HH:mm')}
  27. ${#calendars.arrayFormat(calArray, 'dd/MMM/yyyy HH:mm')}
  28. ${#calendars.listFormat(calList, 'dd/MMM/yyyy HH:mm')}
  29. ${#calendars.setFormat(calSet, 'dd/MMM/yyyy HH:mm')}
  30. /*
  31. * Obtain calendar properties
  32. * Also works with arrays, lists or sets
  33. */
  34. ${#calendars.day(date)} // also arrayDay(...), listDay(...), etc.
  35. ${#calendars.month(date)} // also arrayMonth(...), listMonth(...), etc.
  36. ${#calendars.monthName(date)} // also arrayMonthName(...), listMonthName(...), etc.
  37. ${#calendars.monthNameShort(date)} // also arrayMonthNameShort(...), listMonthNameShort(...), etc.
  38. ${#calendars.year(date)} // also arrayYear(...), listYear(...), etc.
  39. ${#calendars.dayOfWeek(date)} // also arrayDayOfWeek(...), listDayOfWeek(...), etc.
  40. ${#calendars.dayOfWeekName(date)} // also arrayDayOfWeekName(...), listDayOfWeekName(...), etc.
  41. ${#calendars.dayOfWeekNameShort(date)} // also arrayDayOfWeekNameShort(...), listDayOfWeekNameShort(...), etc.
  42. ${#calendars.hour(date)} // also arrayHour(...), listHour(...), etc.
  43. ${#calendars.hour(date)} // also arrayHour(...), listHour(...), etc.
  44. ${#calendars.minute(date)} // also arrayMinute(...), listMinute(...), etc.
  45. ${#calendars.second(date)} // also arraySecond(...), listSecond(...), etc.
  46. ${#calendars.millisecond(date)} // also arrayMillisecond(...), listMillisecond(...), etc.
  47. /*
  48. * Create calendar (java.util.Calendar) objects from its components
  49. */
  50. ${#calendars.create(year,month,day)}
  51. ${#calendars.create(year,month,day,hour,minute)}
  52. ${#calendars.create(year,month,day,hour,minute,second)}
  53. ${#calendars.create(year,month,day,hour,minute,second,millisecond)}
  54. /*
  55. * Create a calendar (java.util.Calendar) object for the current date and time
  56. */
  57. ${#calendars.createNow()}
  58. /*
  59. * Create a calendar (java.util.Calendar) object for the current date (time set to 00:00)
  60. */
  61. ${#calendars.createToday()}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61

#numbers:

  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Numbers
  4. * ======================================================================
  5. */
  6. /*
  7. * ==========================
  8. * Formatting integer numbers
  9. * ==========================
  10. */
  11. /*
  12. * Set minimum integer digits.
  13. * Also works with arrays, lists or sets
  14. */
  15. ${#numbers.formatInteger(num,3)}
  16. ${#numbers.arrayFormatInteger(numArray,3)}
  17. ${#numbers.listFormatInteger(numList,3)}
  18. ${#numbers.setFormatInteger(numSet,3)}
  19. /*
  20. * Set minimum integer digits and thousands separator:
  21. * 'POINT', 'COMMA', 'WHITESPACE', 'NONE' or 'DEFAULT' (by locale).
  22. * Also works with arrays, lists or sets
  23. */
  24. ${#numbers.formatInteger(num,3,'POINT')}
  25. ${#numbers.arrayFormatInteger(numArray,3,'POINT')}
  26. ${#numbers.listFormatInteger(numList,3,'POINT')}
  27. ${#numbers.setFormatInteger(numSet,3,'POINT')}
  28. /*
  29. * ==========================
  30. * Formatting decimal numbers
  31. * ==========================
  32. */
  33. /*
  34. * Set minimum integer digits and (exact) decimal digits.
  35. * Also works with arrays, lists or sets
  36. */
  37. ${#numbers.formatDecimal(num,3,2)}
  38. ${#numbers.arrayFormatDecimal(numArray,3,2)}
  39. ${#numbers.listFormatDecimal(numList,3,2)}
  40. ${#numbers.setFormatDecimal(numSet,3,2)}
  41. /*
  42. * Set minimum integer digits and (exact) decimal digits, and also decimal separator.
  43. * Also works with arrays, lists or sets
  44. */
  45. ${#numbers.formatDecimal(num,3,2,'COMMA')}
  46. ${#numbers.arrayFormatDecimal(numArray,3,2,'COMMA')}
  47. ${#numbers.listFormatDecimal(numList,3,2,'COMMA')}
  48. ${#numbers.setFormatDecimal(numSet,3,2,'COMMA')}
  49. /*
  50. * Set minimum integer digits and (exact) decimal digits, and also thousands and
  51. * decimal separator.
  52. * Also works with arrays, lists or sets
  53. */
  54. ${#numbers.formatDecimal(num,3,'POINT',2,'COMMA')}
  55. ${#numbers.arrayFormatDecimal(numArray,3,'POINT',2,'COMMA')}
  56. ${#numbers.listFormatDecimal(numList,3,'POINT',2,'COMMA')}
  57. ${#numbers.setFormatDecimal(numSet,3,'POINT',2,'COMMA')}
  58. /*
  59. * ==========================
  60. * Utility methods
  61. * ==========================
  62. */
  63. /*
  64. * Create a sequence (array) of integer numbers going
  65. * from x to y
  66. */
  67. ${#numbers.sequence(from,to)}
  68. ${#numbers.sequence(from,to,step)}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68

#strings:

  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Strings
  4. * ======================================================================
  5. */
  6. /*
  7. * Null-safe toString()
  8. */
  9. ${#strings.toString(obj)} // also array*, list* and set*
  10. /*
  11. * Check whether a String is empty (or null). Performs a trim() operation before check
  12. * Also works with arrays, lists or sets
  13. * * Also works with arrays, lists or sets
  14. */
  15. ${#strings.isEmpty(name)}
  16. ${#strings.arrayIsEmpty(nameArr)}
  17. ${#strings.listIsEmpty(nameList)}
  18. ${#strings.setIsEmpty(nameSet)}
  19. /*
  20. * Perform an 'isEmpty()' check on a string and return it if false, defaulting to
  21. * another specified string if true.
  22. * Also works with arrays, lists or sets
  23. */
  24. ${#strings.defaultString(text,default)}
  25. ${#strings.arrayDefaultString(textArr,default)}
  26. ${#strings.listDefaultString(textList,default)}
  27. ${#strings.setDefaultString(textSet,default)}
  28. /*
  29. * Check whether a fragment is contained in a String
  30. * Also works with arrays, lists or sets
  31. */
  32. ${#strings.contains(name,'ez')} // also array*, list* and set*
  33. ${#strings.containsIgnoreCase(name,'ez')} // also array*, list* and set*
  34. /*
  35. * Check whether a String starts or ends with a fragment
  36. * Also works with arrays, lists or sets
  37. */
  38. ${#strings.startsWith(name,'Don')} // also array*, list* and set*
  39. ${#strings.endsWith(name,endingFragment)} // also array*, list* and set*
  40. /*
  41. * Substring-related operations
  42. * Also works with arrays, lists or sets
  43. */
  44. ${#strings.indexOf(name,frag)} // also array*, list* and set*
  45. ${#strings.substring(name,3,5)} // also array*, list* and set*
  46. ${#strings.substringAfter(name,prefix)} // also array*, list* and set*
  47. ${#strings.substringBefore(name,suffix)} // also array*, list* and set*
  48. ${#strings.replace(name,'las','ler')} // also array*, list* and set*
  49. /*
  50. * Append and prepend
  51. * Also works with arrays, lists or sets
  52. */
  53. ${#strings.prepend(str,prefix)} // also array*, list* and set*
  54. ${#strings.append(str,suffix)} // also array*, list* and set*
  55. /*
  56. * Change case
  57. * Also works with arrays, lists or sets
  58. */
  59. ${#strings.toUpperCase(name)} // also array*, list* and set*
  60. ${#strings.toLowerCase(name)} // also array*, list* and set*
  61. /*
  62. * Split and join
  63. */
  64. ${#strings.arrayJoin(namesArray,',')}
  65. ${#strings.listJoin(namesList,',')}
  66. ${#strings.setJoin(namesSet,',')}
  67. ${#strings.arraySplit(namesStr,',')} // returns String[]
  68. ${#strings.listSplit(namesStr,',')} // returns List<String>
  69. ${#strings.setSplit(namesStr,',')} // returns Set<String>
  70. /*
  71. * Trim
  72. * Also works with arrays, lists or sets
  73. */
  74. ${#strings.trim(str)} // also array*, list* and set*
  75. /*
  76. * Compute length
  77. * Also works with arrays, lists or sets
  78. */
  79. ${#strings.length(str)} // also array*, list* and set*
  80. /*
  81. * Abbreviate text making it have a maximum size of n. If text is bigger, it
  82. * will be clipped and finished in "..."
  83. * Also works with arrays, lists or sets
  84. */
  85. ${#strings.abbreviate(str,10)} // also array*, list* and set*
  86. /*
  87. * Convert the first character to upper-case (and vice-versa)
  88. */
  89. ${#strings.capitalize(str)} // also array*, list* and set*
  90. ${#strings.unCapitalize(str)} // also array*, list* and set*
  91. /*
  92. * Convert the first character of every word to upper-case
  93. */
  94. ${#strings.capitalizeWords(str)} // also array*, list* and set*
  95. ${#strings.capitalizeWords(str,delimiters)} // also array*, list* and set*
  96. /*
  97. * Escape the string
  98. */
  99. ${#strings.escapeXml(str)} // also array*, list* and set*
  100. ${#strings.escapeJava(str)} // also array*, list* and set*
  101. ${#strings.escapeJavaScript(str)} // also array*, list* and set*
  102. ${#strings.unescapeJava(str)} // also array*, list* and set*
  103. ${#strings.unescapeJavaScript(str)} // also array*, list* and set*
  104. /*
  105. * Null-safe comparison and concatenation
  106. */
  107. ${#strings.equals(first, second)}
  108. ${#strings.equalsIgnoreCase(first, second)}
  109. ${#strings.concat(values...)}
  110. ${#strings.concatReplaceNulls(nullValue, values...)}
  111. /*
  112. * Random
  113. */
  114. ${#strings.randomAlphanumeric(count)}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114

#objects :

  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Objects
  4. * ======================================================================
  5. */
  6. /*
  7. * Return obj if it is not null, and default otherwise
  8. * Also works with arrays, lists or sets
  9. */
  10. ${#objects.nullSafe(obj,default)}
  11. ${#objects.arrayNullSafe(objArray,default)}
  12. ${#objects.listNullSafe(objList,default)}
  13. ${#objects.setNullSafe(objSet,default)}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

#bools :

  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Bools
  4. * ======================================================================
  5. */
  6. /*
  7. * Evaluate a condition in the same way that it would be evaluated in a th:if tag
  8. * (see conditional evaluation chapter afterwards).
  9. * Also works with arrays, lists or sets
  10. */
  11. ${#bools.isTrue(obj)}
  12. ${#bools.arrayIsTrue(objArray)}
  13. ${#bools.listIsTrue(objList)}
  14. ${#bools.setIsTrue(objSet)}
  15. /*
  16. * Evaluate with negation
  17. * Also works with arrays, lists or sets
  18. */
  19. ${#bools.isFalse(cond)}
  20. ${#bools.arrayIsFalse(condArray)}
  21. ${#bools.listIsFalse(condList)}
  22. ${#bools.setIsFalse(condSet)}
  23. /*
  24. * Evaluate and apply AND operator
  25. * Receive an array, a list or a set as parameter
  26. */
  27. ${#bools.arrayAnd(condArray)}
  28. ${#bools.listAnd(condList)}
  29. ${#bools.setAnd(condSet)}
  30. /*
  31. * Evaluate and apply OR operator
  32. * Receive an array, a list or a set as parameter
  33. */
  34. ${#bools.arrayOr(condArray)}
  35. ${#bools.listOr(condList)}
  36. ${#bools.setOr(condSet)}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36

#arrays :

  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Arrays
  4. * ======================================================================
  5. */
  6. /*
  7. * Converts to array, trying to infer array component class.
  8. * Note that if resulting array is empty, or if the elements
  9. * of the target object are not all of the same class,
  10. * this method will return Object[].
  11. */
  12. ${#arrays.toArray(object)}
  13. /*
  14. * Convert to arrays of the specified component class.
  15. */
  16. ${#arrays.toStringArray(object)}
  17. ${#arrays.toIntegerArray(object)}
  18. ${#arrays.toLongArray(object)}
  19. ${#arrays.toDoubleArray(object)}
  20. ${#arrays.toFloatArray(object)}
  21. ${#arrays.toBooleanArray(object)}
  22. /*
  23. * Compute length
  24. */
  25. ${#arrays.length(array)}
  26. /*
  27. * Check whether array is empty
  28. */
  29. ${#arrays.isEmpty(array)}
  30. /*
  31. * Check if element or elements are contained in array
  32. */
  33. ${#arrays.contains(array, element)}
  34. ${#arrays.containsAll(array, elements)}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34

#lists :

  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Lists
  4. * ======================================================================
  5. */
  6. /*
  7. * Converts to list
  8. */
  9. ${#lists.toList(object)}
  10. /*
  11. * Compute size
  12. */
  13. ${#lists.size(list)}
  14. /*
  15. * Check whether list is empty
  16. */
  17. ${#lists.isEmpty(list)}
  18. /*
  19. * Check if element or elements are contained in list
  20. */
  21. ${#lists.contains(list, element)}
  22. ${#lists.containsAll(list, elements)}
  23. /*
  24. * Sort a copy of the given list. The members of the list must implement
  25. * comparable or you must define a comparator.
  26. */
  27. ${#lists.sort(list)}
  28. ${#lists.sort(list, comparator)}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28

#sets :

  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Sets
  4. * ======================================================================
  5. */
  6. /*
  7. * Converts to set
  8. */
  9. ${#sets.toSet(object)}
  10. /*
  11. * Compute size
  12. */
  13. ${#sets.size(set)}
  14. /*
  15. * Check whether set is empty
  16. */
  17. ${#sets.isEmpty(set)}
  18. /*
  19. * Check if element or elements are contained in set
  20. */
  21. ${#sets.contains(set, element)}
  22. ${#sets.containsAll(set, elements)}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

#maps :

  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Maps
  4. * ======================================================================
  5. */
  6. /*
  7. * Compute size
  8. */
  9. ${#maps.size(map)}
  10. /*
  11. * Check whether map is empty
  12. */
  13. ${#maps.isEmpty(map)}
  14. /*
  15. * Check if key/s or value/s are contained in maps
  16. */
  17. ${#maps.containsKey(map, key)}
  18. ${#maps.containsAllKeys(map, keys)}
  19. ${#maps.containsValue(map, value)}
  20. ${#maps.containsAllValues(map, value)}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

#aggregates :

  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Aggregates
  4. * ======================================================================
  5. */
  6. /*
  7. * Compute sum. Returns null if array or collection is empty
  8. */
  9. ${#aggregates.sum(array)}
  10. ${#aggregates.sum(collection)}
  11. /*
  12. * Compute average. Returns null if array or collection is empty
  13. */
  14. ${#aggregates.avg(array)}
  15. ${#aggregates.avg(collection)}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

#messages :

  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Messages
  4. * ======================================================================
  5. */
  6. /*
  7. * Obtain externalized messages. Can receive a single key, a key plus arguments,
  8. * or an array/list/set of keys (in which case it will return an array/list/set of
  9. * externalized messages).
  10. * If a message is not found, a default message (like '??msgKey??') is returned.
  11. */
  12. ${#messages.msg('msgKey')}
  13. ${#messages.msg('msgKey', param1)}
  14. ${#messages.msg('msgKey', param1, param2)}
  15. ${#messages.msg('msgKey', param1, param2, param3)}
  16. ${#messages.msgWithParams('msgKey', new Object[] {param1, param2, param3, param4})}
  17. ${#messages.arrayMsg(messageKeyArray)}
  18. ${#messages.listMsg(messageKeyList)}
  19. ${#messages.setMsg(messageKeySet)}
  20. /*
  21. * Obtain externalized messages or null. Null is returned instead of a default
  22. * message if a message for the specified key is not found.
  23. */
  24. ${#messages.msgOrNull('msgKey')}
  25. ${#messages.msgOrNull('msgKey', param1)}
  26. ${#messages.msgOrNull('msgKey', param1, param2)}
  27. ${#messages.msgOrNull('msgKey', param1, param2, param3)}
  28. ${#messages.msgOrNullWithParams('msgKey', new Object[] {param1, param2, param3, param4})}
  29. ${#messages.arrayMsgOrNull(messageKeyArray)}
  30. ${#messages.listMsgOrNull(messageKeyList)}
  31. ${#messages.setMsgOrNull(messageKeySet)}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

#ids :

  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Ids
  4. * ======================================================================
  5. */
  6. /*
  7. * Normally used in th:id attributes, for appending a counter to the id attribute value
  8. * so that it remains unique even when involved in an iteration process.
  9. */
  10. ${#ids.seq('someId')}
  11. /*
  12. * Normally used in th:for attributes in <label> tags, so that these labels can refer to Ids
  13. * generated by means if the #ids.seq(...) function.
  14. *
  15. * Depending on whether the <label> goes before or after the element with the #ids.seq(...)
  16. * function, the "next" (label goes before "seq") or the "prev" function (label goes after
  17. * "seq") function should be called.
  18. */
  19. ${#ids.next('someId')}
  20. ${#ids.prev('someId')}

Thymeleaf:工具对象用法的更多相关文章

  1. Linux截屏工具scrot用法详细介绍

    Scrot是Linux命令行中使用的截图工具,能够进行全屏.选取等操作,下面小编将针对Scrot截图工具的用法给大家做个详细介绍,通过操作实例来学习Scrot的使用.   在Linux中安装Scrot ...

  2. Apache自带压力测试工具ab用法简介

    ab命令原理 ab命令会创建很多的并发访问线程,模拟多个访问者同时对某一URL进行访问.它的测试目标是基于URL的,因此,既可以用来测试Apache的负载压力,也可以测试nginx.lighthttp ...

  3. javascript之自定义数组工具对象

    <pre name="code" class="html">/* 需求:编写一个js文件,在js文件中自定义一个数组工具对象, 该工具对象要有一个找 ...

  4. Mysql优化_慢查询开启说明及Mysql慢查询分析工具mysqldumpslow用法讲解

    Mysql优化_慢查询开启说明及Mysql慢查询分析工具mysqldumpslow用法讲解   Mysql慢查询开启 Mysql的查询讯日志是Mysql提供的一种日志记录,它用来记录在Mysql中响应 ...

  5. MFC绘图相关GDI工具对象和函数介绍

    在利用MFC进行界面编程时,除了需要熟悉各种类型控件的操作外,还会经常遇到图形绘制和显示的问题,比如时频分析界面.图像处理界面等.处理这些软件界面开发问题时,不可避免地需要用到一系列GDI工具对象和相 ...

  6. 孤荷凌寒自学python第七十天学习并实践beautifulsoup对象用法3

    孤荷凌寒自学python第七十天学习并实践beautifulsoup对象用法3 (完整学习过程屏幕记录视频地址在文末) 今天继续学习beautifulsoup对象的属性与方法等内容. 一.今天进一步了 ...

  7. 孤荷凌寒自学python第六十九天学习并实践beautifulsoup对象用法2

    孤荷凌寒自学python第六十九天学习并实践beautifulsoup对象用法2 (完整学习过程屏幕记录视频地址在文末) 今天继续学习beautifulsoup对象的属性与方法等内容. 一.今天进一步 ...

  8. logging 为全局的日志工具对象添加日志记录器

    def log_file(LEVEL_NAME): # 设置日志的记录等级,常见的有四种,大小关系如下,DEBUG < INFO < WARNING <ERROR # 一旦设置级别, ...

  9. Java 代码规范,你应该知道的一些工具和用法(转)

    转自:http://yifeng.studio/2017/06/30/coding-with-code-style/ Java 代码规范,你应该知道的一些工具和用法 2017-06-30 从事编程这个 ...

随机推荐

  1. 【Android】实例 忐忑的精灵

    在Android Studio中创建项目,名称为“Animation And Multimedia”,然后在该项目中创建一个Module,名称为“Frame-By-Frame Animation”.在 ...

  2. Java_Web之JSTL和EL

    今天学了JSTL和EL,替换了以前for循环,感觉代码越来越少了,十分方便.JSTL和EL密不可分. 一.什么是EL表达式? 什么是EL EL即Expression Language(表达式语言) E ...

  3. 读书笔记「Python编程:从入门到实践」_5.if语句

    5.1 一个简单示例 cars = ['audi', 'bmw', 'subaru', 'toyota'] for car in cars: if car == 'bmw': print(car.up ...

  4. Python【每日一问】35

    问: 基础题: 从键盘输入4个数字,各数字采用空格分隔,对应为变量x0,y0,x1,y1.计算(x0,y0)和(x1,y1)两点之间的距离,输出结果保留1位小数. 比如,键盘输入:0 1 3 5,屏幕 ...

  5. 高举 Vue-SSR

    将同一个组件渲染为服务器端的 HTML 字符串,将它们直接发送到浏览器,最后将静态标记"混合"为客户端上完全交互的应用程序. SSR的目的 To solve 首屏渲染问题 SEO问 ...

  6. java陷阱之自动拆箱

    项目中突然报空指针异常 Integer code=null; code=code==null?500:code; 排查发现三元运算符空指针异常,表面上看不出来有什么问题,编译器编译的时候会保证:2边数 ...

  7. mysql 与elasticsearch实时同步常用插件及优缺点对比(ES与关系型数据库同步)

    前言: 目前mysql与elasticsearch常用的同步机制大多是基于插件实现的,常用的插件包括:elasticsearch-jdbc, elasticsearch-river-MySQL , g ...

  8. [bzoj4027][HEOI2015]兔子与樱花_贪心_树形dp

    兔子与樱花 bzoj-4027 HEOI-2015 题目大意:每个点有c[i]朵樱花,有一个称重m, son[i]+c[i]<=m.如果删除一个节点,这个节点的樱花或移动到它的祖先中深度最大的, ...

  9. 杭电(hdu)ACM 1010 Tempter of the Bone

    Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

  10. [Cypress] Get started with Cypress

    Adding Cypress to a project is a simple npm install away. We won’t need any global dependencies beyo ...