Thymeleaf学习记录(8)--表达式基本对象
基础对象
#ctx:上下文对象
/*
* ======================================================================
* See javadoc API for class org.thymeleaf.context.IContext
* ======================================================================
*/ ${#ctx.locale}
${#ctx.variables} /*
* ======================================================================
* See javadoc API for class org.thymeleaf.context.IWebContext
* ======================================================================
*/ ${#ctx.applicationAttributes}
${#ctx.httpServletRequest}
${#ctx.httpServletResponse}
${#ctx.httpSession}
${#ctx.requestAttributes}
${#ctx.requestParameters}
${#ctx.servletContext}
${#ctx.sessionAttributes}
#locale:直接访问java.util.Locale
与当前请求关联的
#vars:org.thymeleaf.context.VariablesMap
上下文中所有变量的实例(通常包含在#ctx.variables
加本地变量中的变量)。
/*
* ======================================================================
* See javadoc API for class org.thymeleaf.context.VariablesMap
* ======================================================================
*/ ${#vars.get('foo')}
${#vars.containsKey('foo')}
${#vars.size()}
...
请求/会话属性的Web上下文命名空间等。
- param:用于检索请求参数。${param.foo}是一个String[]带有foo请求参数值的,因此${param.foo[0]}通常用于获取第一个值。
• /*
• * ============================================================================
• * See javadoc API for class org.thymeleaf.context.WebRequestParamsVariablesMap
• * ============================================================================
• */
•
• ${param.foo} // Retrieves a String[] with the values of request parameter 'foo'
• ${param.size()}
• ${param.isEmpty()}
• ${param.containsKey('foo')}
• ...
- session:用于检索会话属性。
• /*
• * ======================================================================
• * See javadoc API for class org.thymeleaf.context.WebSessionVariablesMap
• * ======================================================================
• */
•
• ${session.foo} // Retrieves the session atttribute 'foo'
• ${session.size()}
• ${session.isEmpty()}
• ${session.containsKey('foo')}
• ...
- application:用于检索应用程序/ servlet上下文属性。
• /*
• * =============================================================================
• * See javadoc API for class org.thymeleaf.context.WebServletContextVariablesMap
• * =============================================================================
• */
•
• ${application.foo} // Retrieves the ServletContext atttribute 'foo'
• ${application.size()}
• ${application.isEmpty()}
• ${application.containsKey('foo')}
• ...
Web上下文对象
#httpServletRequest:直接访问javax.servlet.http.HttpServletRequest
与当前请求关联的对象
${#httpServletRequest.getAttribute('foo')}
${#httpServletRequest.getParameter('foo')}
${#httpServletRequest.getContextPath()}
${#httpServletRequest.getRequestName()}
...
- #httpSession:直接访问javax.servlet.http.HttpSession与当前请求关联的对象。
• ${#httpSession.getAttribute('foo')}
• ${#httpSession.id}
• ${#httpSession.lastAccessedTime}
• ...
Spring上下文对象
#themes:提供与Spring spring:theme
JSP标记相同的功能
表达式实用程序对象
#dates:java.util.Date
对象的实用方法
/*
* ======================================================================
* See javadoc API for class org.thymeleaf.expression.Dates
* ======================================================================
*/ /*
* Format date with the standard locale format
* Also works with arrays, lists or sets
*/
${#dates.format(date)}
${#dates.arrayFormat(datesArray)}
${#dates.listFormat(datesList)}
${#dates.setFormat(datesSet)} /*
* Format date with the ISO8601 format
* Also works with arrays, lists or sets
*/
${#dates.formatISO(date)}
${#dates.arrayFormatISO(datesArray)}
${#dates.listFormatISO(datesList)}
${#dates.setFormatISO(datesSet)} /*
* Format date with the specified pattern
* Also works with arrays, lists or sets
*/
${#dates.format(date, 'dd/MMM/yyyy HH:mm')}
${#dates.arrayFormat(datesArray, 'dd/MMM/yyyy HH:mm')}
${#dates.listFormat(datesList, 'dd/MMM/yyyy HH:mm')}
${#dates.setFormat(datesSet, 'dd/MMM/yyyy HH:mm')} /*
* Obtain date properties
* Also works with arrays, lists or sets
*/
${#dates.day(date)} // also arrayDay(...), listDay(...), etc.
${#dates.month(date)} // also arrayMonth(...), listMonth(...), etc.
${#dates.monthName(date)} // also arrayMonthName(...), listMonthName(...), etc.
${#dates.monthNameShort(date)} // also arrayMonthNameShort(...), listMonthNameShort(...), etc.
${#dates.year(date)} // also arrayYear(...), listYear(...), etc.
${#dates.dayOfWeek(date)} // also arrayDayOfWeek(...), listDayOfWeek(...), etc.
${#dates.dayOfWeekName(date)} // also arrayDayOfWeekName(...), listDayOfWeekName(...), etc.
${#dates.dayOfWeekNameShort(date)} // also arrayDayOfWeekNameShort(...), listDayOfWeekNameShort(...), etc.
${#dates.hour(date)} // also arrayHour(...), listHour(...), etc.
${#dates.minute(date)} // also arrayMinute(...), listMinute(...), etc.
${#dates.second(date)} // also arraySecond(...), listSecond(...), etc.
${#dates.millisecond(date)} // also arrayMillisecond(...), listMillisecond(...), etc. /*
* Create date (java.util.Date) objects from its components
*/
${#dates.create(year,month,day)}
${#dates.create(year,month,day,hour,minute)}
${#dates.create(year,month,day,hour,minute,second)}
${#dates.create(year,month,day,hour,minute,second,millisecond)} /*
* Create a date (java.util.Date) object for the current date and time
*/
${#dates.createNow()} ${#dates.createNowForTimeZone()} /*
* Create a date (java.util.Date) object for the current date (time set to 00:00)
*/
${#dates.createToday()} ${#dates.createTodayForTimeZone()}
- #calendars:类似于#dates,但对于java.util.Calendar对象:
• /*
• * ======================================================================
• * See javadoc API for class org.thymeleaf.expression.Calendars
• * ======================================================================
• */
•
• /*
• * Format calendar with the standard locale format
• * Also works with arrays, lists or sets
• */
• ${#calendars.format(cal)}
• ${#calendars.arrayFormat(calArray)}
• ${#calendars.listFormat(calList)}
• ${#calendars.setFormat(calSet)}
•
• /*
• * Format calendar with the ISO8601 format
• * Also works with arrays, lists or sets
• */
• ${#calendars.formatISO(cal)}
• ${#calendars.arrayFormatISO(calArray)}
• ${#calendars.listFormatISO(calList)}
• ${#calendars.setFormatISO(calSet)}
•
• /*
• * Format calendar with the specified pattern
• * Also works with arrays, lists or sets
• */
• ${#calendars.format(cal, 'dd/MMM/yyyy HH:mm')}
• ${#calendars.arrayFormat(calArray, 'dd/MMM/yyyy HH:mm')}
• ${#calendars.listFormat(calList, 'dd/MMM/yyyy HH:mm')}
• ${#calendars.setFormat(calSet, 'dd/MMM/yyyy HH:mm')}
•
• /*
• * Obtain calendar properties
• * Also works with arrays, lists or sets
• */
• ${#calendars.day(date)} // also arrayDay(...), listDay(...), etc.
• ${#calendars.month(date)} // also arrayMonth(...), listMonth(...), etc.
• ${#calendars.monthName(date)} // also arrayMonthName(...), listMonthName(...), etc.
• ${#calendars.monthNameShort(date)} // also arrayMonthNameShort(...), listMonthNameShort(...), etc.
• ${#calendars.year(date)} // also arrayYear(...), listYear(...), etc.
• ${#calendars.dayOfWeek(date)} // also arrayDayOfWeek(...), listDayOfWeek(...), etc.
• ${#calendars.dayOfWeekName(date)} // also arrayDayOfWeekName(...), listDayOfWeekName(...), etc.
• ${#calendars.dayOfWeekNameShort(date)} // also arrayDayOfWeekNameShort(...), listDayOfWeekNameShort(...), etc.
• ${#calendars.hour(date)} // also arrayHour(...), listHour(...), etc.
• ${#calendars.minute(date)} // also arrayMinute(...), listMinute(...), etc.
• ${#calendars.second(date)} // also arraySecond(...), listSecond(...), etc.
• ${#calendars.millisecond(date)} // also arrayMillisecond(...), listMillisecond(...), etc.
•
• /*
• * Create calendar (java.util.Calendar) objects from its components
• */
• ${#calendars.create(year,month,day)}
• ${#calendars.create(year,month,day,hour,minute)}
• ${#calendars.create(year,month,day,hour,minute,second)}
• ${#calendars.create(year,month,day,hour,minute,second,millisecond)}
•
• ${#calendars.createForTimeZone(year,month,day,timeZone)}
• ${#calendars.createForTimeZone(year,month,day,hour,minute,timeZone)}
• ${#calendars.createForTimeZone(year,month,day,hour,minute,second,timeZone)}
• ${#calendars.createForTimeZone(year,month,day,hour,minute,second,millisecond,timeZone)}
•
• /*
• * Create a calendar (java.util.Calendar) object for the current date and time
• */
• ${#calendars.createNow()}
•
• ${#calendars.createNowForTimeZone()}
•
• /*
• * Create a calendar (java.util.Calendar) object for the current date (time set to 00:00)
• */
• ${#calendars.createToday()}
•
• ${#calendars.createTodayForTimeZone()}
- #numbers:数字对象的实用方法:
• /*
• * ======================================================================
• * See javadoc API for class org.thymeleaf.expression.Numbers
• * ======================================================================
• */
•
• /*
• * ==========================
• * Formatting integer numbers
• * ==========================
• */
•
• /*
• * Set minimum integer digits.
• * Also works with arrays, lists or sets
• */
• ${#numbers.formatInteger(num,3)}
• ${#numbers.arrayFormatInteger(numArray,3)}
• ${#numbers.listFormatInteger(numList,3)}
• ${#numbers.setFormatInteger(numSet,3)}
•
•
• /*
• * Set minimum integer digits and thousands separator:
• * 'POINT', 'COMMA', 'WHITESPACE', 'NONE' or 'DEFAULT' (by locale).
• * Also works with arrays, lists or sets
• */
• ${#numbers.formatInteger(num,3,'POINT')}
• ${#numbers.arrayFormatInteger(numArray,3,'POINT')}
• ${#numbers.listFormatInteger(numList,3,'POINT')}
• ${#numbers.setFormatInteger(numSet,3,'POINT')}
•
•
• /*
• * ==========================
• * Formatting decimal numbers
• * ==========================
• */
•
• /*
• * Set minimum integer digits and (exact) decimal digits.
• * Also works with arrays, lists or sets
• */
• ${#numbers.formatDecimal(num,3,2)}
• ${#numbers.arrayFormatDecimal(numArray,3,2)}
• ${#numbers.listFormatDecimal(numList,3,2)}
• ${#numbers.setFormatDecimal(numSet,3,2)}
•
• /*
• * Set minimum integer digits and (exact) decimal digits, and also decimal separator.
• * Also works with arrays, lists or sets
• */
• ${#numbers.formatDecimal(num,3,2,'COMMA')}
• ${#numbers.arrayFormatDecimal(numArray,3,2,'COMMA')}
• ${#numbers.listFormatDecimal(numList,3,2,'COMMA')}
• ${#numbers.setFormatDecimal(numSet,3,2,'COMMA')}
•
• /*
• * Set minimum integer digits and (exact) decimal digits, and also thousands and
• * decimal separator.
• * Also works with arrays, lists or sets
• */
• ${#numbers.formatDecimal(num,3,'POINT',2,'COMMA')}
• ${#numbers.arrayFormatDecimal(numArray,3,'POINT',2,'COMMA')}
• ${#numbers.listFormatDecimal(numList,3,'POINT',2,'COMMA')}
• ${#numbers.setFormatDecimal(numSet,3,'POINT',2,'COMMA')}
•
•
•
• /*
• * ==========================
• * Utility methods
• * ==========================
• */
•
• /*
• * Create a sequence (array) of integer numbers going
• * from x to y
• */
• ${#numbers.sequence(from,to)}
• ${#numbers.sequence(from,to,step)}
- #strings:
String
对象的实用方法
/*
* ======================================================================
* See javadoc API for class org.thymeleaf.expression.Strings
* ======================================================================
*/ /*
* Null-safe toString()
*/
${#strings.toString(obj)} // also array*, list* and set* /*
* Check whether a String is empty (or null). Performs a trim() operation before check
* Also works with arrays, lists or sets
*/
${#strings.isEmpty(name)}
${#strings.arrayIsEmpty(nameArr)}
${#strings.listIsEmpty(nameList)}
${#strings.setIsEmpty(nameSet)} /*
* Perform an 'isEmpty()' check on a string and return it if false, defaulting to
* another specified string if true.
* Also works with arrays, lists or sets
*/
${#strings.defaultString(text,default)}
${#strings.arrayDefaultString(textArr,default)}
${#strings.listDefaultString(textList,default)}
${#strings.setDefaultString(textSet,default)} /*
* Check whether a fragment is contained in a String
* Also works with arrays, lists or sets
*/
${#strings.contains(name,'ez')} // also array*, list* and set*
${#strings.containsIgnoreCase(name,'ez')} // also array*, list* and set* /*
* Check whether a String starts or ends with a fragment
* Also works with arrays, lists or sets
*/
${#strings.startsWith(name,'Don')} // also array*, list* and set*
${#strings.endsWith(name,endingFragment)} // also array*, list* and set* /*
* Substring-related operations
* Also works with arrays, lists or sets
*/
${#strings.indexOf(name,frag)} // also array*, list* and set*
${#strings.substring(name,3,5)} // also array*, list* and set*
${#strings.substringAfter(name,prefix)} // also array*, list* and set*
${#strings.substringBefore(name,suffix)} // also array*, list* and set*
${#strings.replace(name,'las','ler')} // also array*, list* and set* /*
* Append and prepend
* Also works with arrays, lists or sets
*/
${#strings.prepend(str,prefix)} // also array*, list* and set*
${#strings.append(str,suffix)} // also array*, list* and set* /*
* Change case
* Also works with arrays, lists or sets
*/
${#strings.toUpperCase(name)} // also array*, list* and set*
${#strings.toLowerCase(name)} // also array*, list* and set* /*
* Split and join
*/
${#strings.arrayJoin(namesArray,',')}
${#strings.listJoin(namesList,',')}
${#strings.setJoin(namesSet,',')}
${#strings.arraySplit(namesStr,',')} // returns String[]
${#strings.listSplit(namesStr,',')} // returns List<String>
${#strings.setSplit(namesStr,',')} // returns Set<String> /*
* Trim
* Also works with arrays, lists or sets
*/
${#strings.trim(str)} // also array*, list* and set* /*
* Compute length
* Also works with arrays, lists or sets
*/
${#strings.length(str)} // also array*, list* and set* /*
* Abbreviate text making it have a maximum size of n. If text is bigger, it
* will be clipped and finished in "..."
* Also works with arrays, lists or sets
*/
${#strings.abbreviate(str,10)} // also array*, list* and set* /*
* Convert the first character to upper-case (and vice-versa)
*/
${#strings.capitalize(str)} // also array*, list* and set*
${#strings.unCapitalize(str)} // also array*, list* and set* /*
* Convert the first character of every word to upper-case
*/
${#strings.capitalizeWords(str)} // also array*, list* and set*
${#strings.capitalizeWords(str,delimiters)} // also array*, list* and set* /*
* Escape the string
*/
${#strings.escapeXml(str)} // also array*, list* and set*
${#strings.escapeJava(str)} // also array*, list* and set*
${#strings.escapeJavaScript(str)} // also array*, list* and set*
${#strings.unescapeJava(str)} // also array*, list* and set*
${#strings.unescapeJavaScript(str)} // also array*, list* and set* /*
* Null-safe comparison and concatenation
*/
${#strings.equals(first, second)}
${#strings.equalsIgnoreCase(first, second)}
${#strings.concat(values...)}
${#strings.concatReplaceNulls(nullValue, values...)} /*
* Random
*/
${#strings.randomAlphanumeric(count)}
- #objects:一般对象的实用程序方法
• /*
• * ======================================================================
• * See javadoc API for class org.thymeleaf.expression.Objects
• * ======================================================================
• */
•
• /*
• * Return obj if it is not null, and default otherwise
• * Also works with arrays, lists or sets
• */
• ${#objects.nullSafe(obj,default)}
• ${#objects.arrayNullSafe(objArray,default)}
• ${#objects.listNullSafe(objList,default)}
• ${#objects.setNullSafe(objSet,default)}
- #bools:布尔评估的实用程序方法
• /*
• * ======================================================================
• * See javadoc API for class org.thymeleaf.expression.Bools
• * ======================================================================
• */
•
• /*
• * Evaluate a condition in the same way that it would be evaluated in a th:if tag
• * (see conditional evaluation chapter afterwards).
• * Also works with arrays, lists or sets
• */
• ${#bools.isTrue(obj)}
• ${#bools.arrayIsTrue(objArray)}
• ${#bools.listIsTrue(objList)}
• ${#bools.setIsTrue(objSet)}
•
• /*
• * Evaluate with negation
• * Also works with arrays, lists or sets
• */
• ${#bools.isFalse(cond)}
• ${#bools.arrayIsFalse(condArray)}
• ${#bools.listIsFalse(condList)}
• ${#bools.setIsFalse(condSet)}
•
• /*
• * Evaluate and apply AND operator
• * Receive an array, a list or a set as parameter
• */
• ${#bools.arrayAnd(condArray)}
• ${#bools.listAnd(condList)}
• ${#bools.setAnd(condSet)}
•
• /*
• * Evaluate and apply OR operator
• * Receive an array, a list or a set as parameter
• */
• ${#bools.arrayOr(condArray)}
• ${#bools.listOr(condList)}
• ${#bools.setOr(condSet)}
- #arrays:数组的实用程序方法
• /*
• * ======================================================================
• * See javadoc API for class org.thymeleaf.expression.Arrays
• * ======================================================================
• */
•
• /*
• * Converts to array, trying to infer array component class.
• * Note that if resulting array is empty, or if the elements
• * of the target object are not all of the same class,
• * this method will return Object[].
• */
• ${#arrays.toArray(object)}
•
• /*
• * Convert to arrays of the specified component class.
• */
• ${#arrays.toStringArray(object)}
• ${#arrays.toIntegerArray(object)}
• ${#arrays.toLongArray(object)}
• ${#arrays.toDoubleArray(object)}
• ${#arrays.toFloatArray(object)}
• ${#arrays.toBooleanArray(object)}
•
• /*
• * Compute length
• */
• ${#arrays.length(array)}
•
• /*
• * Check whether array is empty
• */
• ${#arrays.isEmpty(array)}
•
• /*
• * Check if element or elements are contained in array
• */
• ${#arrays.contains(array, element)}
• ${#arrays.containsAll(array, elements)}
- #lists:列表的实用程序方法
• /*
• * ======================================================================
• * See javadoc API for class org.thymeleaf.expression.Lists
• * ======================================================================
• */
•
• /*
• * Converts to list
• */
• ${#lists.toList(object)}
•
• /*
• * Compute size
• */
• ${#lists.size(list)}
•
• /*
• * Check whether list is empty
• */
• ${#lists.isEmpty(list)}
•
• /*
• * Check if element or elements are contained in list
• */
• ${#lists.contains(list, element)}
• ${#lists.containsAll(list, elements)}
•
• /*
• * Sort a copy of the given list. The members of the list must implement
• * comparable or you must define a comparator.
• */
• ${#lists.sort(list)}
• ${#lists.sort(list, comparator)
- #sets:集合的实用程序方法
• /*
• * ======================================================================
• * See javadoc API for class org.thymeleaf.expression.Sets
• * ======================================================================
• */
•
• /*
• * Converts to set
• */
• ${#sets.toSet(object)}
•
• /*
• * Compute size
• */
• ${#sets.size(set)}
•
• /*
• * Check whether set is empty
• */
• ${#sets.isEmpty(set)}
•
• /*
• * Check if element or elements are contained in set
• */
• ${#sets.contains(set, element)}
• ${#sets.containsAll(set, elements)}
- #maps:地图的实用程序方法
• /*
• * ======================================================================
• * See javadoc API for class org.thymeleaf.expression.Maps
• * ======================================================================
• */
•
• /*
• * Compute size
• */
• ${#maps.size(map)}
•
• /*
• * Check whether map is empty
• */
• ${#maps.isEmpty(map)}
•
• /*
• * Check if key/s or value/s are contained in maps
• */
• ${#maps.containsKey(map, key)}
• ${#maps.containsAllKeys(map, keys)}
• ${#maps.containsValue(map, value)}
• ${#maps.containsAllValues(map, value)}
- #aggregates:用于在数组或集合上创建聚合的实用程序方法
• /*
• * ======================================================================
• * See javadoc API for class org.thymeleaf.expression.Aggregates
• * ======================================================================
• */
•
• /*
• * Compute sum. Returns null if array or collection is empty
• */
• ${#aggregates.sum(array)}
• ${#aggregates.sum(collection)}
•
• /*
• * Compute average. Returns null if array or collection is empty
• */
• ${#aggregates.avg(array)}
• ${#aggregates.avg(collection)}
- #messages:用于在变量表达式中获取外部化消息的实用程序方法,与使用#{...}语法获取它们的方式相同。
• /*
• * ======================================================================
• * See javadoc API for class org.thymeleaf.expression.Messages
• * ======================================================================
• */
•
• /*
• * Obtain externalized messages. Can receive a single key, a key plus arguments,
• * or an array/list/set of keys (in which case it will return an array/list/set of
• * externalized messages).
• * If a message is not found, a default message (like '??msgKey??') is returned.
• */
• ${#messages.msg('msgKey')}
• ${#messages.msg('msgKey', param1)}
• ${#messages.msg('msgKey', param1, param2)}
• ${#messages.msg('msgKey', param1, param2, param3)}
• ${#messages.msgWithParams('msgKey', new Object[] {param1, param2, param3, param4})}
• ${#messages.arrayMsg(messageKeyArray)}
• ${#messages.listMsg(messageKeyList)}
• ${#messages.setMsg(messageKeySet)}
•
• /*
• * Obtain externalized messages or null. Null is returned instead of a default
• * message if a message for the specified key is not found.
• */
• ${#messages.msgOrNull('msgKey')}
• ${#messages.msgOrNull('msgKey', param1)}
• ${#messages.msgOrNull('msgKey', param1, param2)}
• ${#messages.msgOrNull('msgKey', param1, param2, param3)}
• ${#messages.msgOrNullWithParams('msgKey', new Object[] {param1, param2, param3, param4})}
• ${#messages.arrayMsgOrNull(messageKeyArray)}
• ${#messages.listMsgOrNull(messageKeyList)}
• ${#messages.setMsgOrNull(messageKeySet)}
- #ids:用于处理id可能重复的属性的实用程序方法(例如,作为迭代的结果)。
• /*
• * ======================================================================
• * See javadoc API for class org.thymeleaf.expression.Ids
• * ======================================================================
• */
•
• /*
• * Normally used in th:id attributes, for appending a counter to the id attribute value
• * so that it remains unique even when involved in an iteration process.
• */
• ${#ids.seq('someId')}
•
• /*
• * Normally used in th:for attributes in <label> tags, so that these labels can refer to Ids
• * generated by means if the #ids.seq(...) function.
• *
• * Depending on whether the <label> goes before or after the element with the #ids.seq(...)
• * function, the "next" (label goes before "seq") or the "prev" function (label goes after
• * "seq") function should be called.
• */
• ${#ids.next('someId')}
• ${#ids.prev('someId')}
使用示例:
Thymeleaf学习记录(8)--表达式基本对象的更多相关文章
- Spring学习记录(七)---表达式语言-SpEL
SpEL---Spring Expression Language:是一个支持运行时查询和操作对象图表达式语言.使用#{...}作为定界符,为bean属性动态赋值提供了便利. ①对于普通的赋值,用Sp ...
- Thymeleaf学习记录(3)--语法
语法: 标准表达式语法 简单表达: 变量表达式: ${...} 选择变量表达式: *{...} 消息表达式: #{...} 链接网址表达式: @{...} 字面 文本文字:'one text','An ...
- Thymeleaf学习记录(4)--$/*/#/@语法
表达式符号 Thymeleaf对于变量的操作主要有$\*\#三种方式: 变量表达式: ${...},是获取容器上下文变量的值. 选择变量表达式: *{...},获取指定的对象中的变量值.如果是单独的对 ...
- Thymeleaf学习记录(7)--页面引入/片段引入
1.为页面添加footer: Templates文件夹下新建HTML文件: <!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xh ...
- Thymeleaf学习记录(6)--迭代及条件语法
迭代: 条件选择: IF-THEN: (if) ? (then) IF-THEN-ELSE: (if) ? (then) : (else) 默认: (value) ?: (defaultvalue) ...
- Erlang学习记录(三)——表达式大集合
Erlang中的表达式必须以.结束才会去执行.如果不加.你在编译环境下按多少次Enter,表达式都不会执行,表达式之间可以用,分隔,以.结尾后所有的表达式都会执行,但是只有最后一个以.结尾的表达式会在 ...
- Thymeleaf学习记录(1)--启动模板及建立Demo
Thymeleaf是什么? Thymeleaf是适用于Web和独立环境的现代服务器端Java模板引擎.相比于JSP,Thymeleaf更简洁,渲染性能更好,维护性更好,它可以XML/XHTML/HTM ...
- Thymeleaf学习记录(5)--运算及表单
Thymeleaf文本及预算: 字面 文本文字:'one text','Another one!',... 号码文字:0,34,3.0,12.3,... 布尔文字:true,false 空字面: nu ...
- Thymeleaf学习记录(2)--自动编译设置
了方便每次修改HTML文件都能实时刷新,做一下更改. 在application.properties文件加入以下命令: #thymeleaf start spring.thymeleaf.mode=H ...
随机推荐
- Oracle的常用修改表及字段的语句
单行注释:-- 多行注释:/* */ Oracle中修改表结构 增加字段 ALTER TABLE table_name ADD column_name data_type; 删除字段 ...
- java的应用,SVN客户端的安装教程
1.先注册一个百度云账号,然后打开https://console.bce.baidu.com 这个网站,按照下面的图形点击 !!!!请注意这是要收钱的,但能学习到那用微信打开你的网站也是值得的. 2. ...
- psp0级报告
计划 1.1需求描述: 现在市场上有很多的面向小学生的题卡,但是这习题卡不但价格昂贵,而且每次做题的内容基本都是固定.针对这些问题,开发出了这款网页在线答题系统,每次的题目都有所不同,可以跟快更好提高 ...
- Vue-cli 2.9 多页配置及多页面之间的跳转问题
vue开发,现在大部分做的都是(SPA)应用,但是,由于,需求不同,我们针对的用户需求变更较为,频繁,如果每次都全量打包更新,给开发的自测,及测试妹子的任务就会多,每次都要重新验证一下才放心.所以,想 ...
- HDU - 6133 启发式合并
题意:给出一棵树共\(n\)个顶点,每个顶点有一个权值\(val_i\),你需要对每个节点统计一个最优解 每个节点的解按照一定规则产生:取出该节点的子树下所有的顶点,把顶点任意排序成一个序列,设为\( ...
- Mac 10.12安装StarUML
说明:这款是收费软件,但是可以不缴费继续使用,然后就是有弹框提示收费而已.基本揽括了时序图.用例图.流程图等等.主要是跨平台且小巧. 下载: (链接: https://pan.baidu.com/s/ ...
- 全面解析C#中参数传递
一.引言 对于一些初学者(包括工作几年的人在内)来说,有时候对于方法之间的参数传递的问题感觉比较困惑的,因为之前在面试的过程也经常遇到参数传递的基础面试题,这样的面试题主要考察的开发人员基础是否扎实, ...
- Django时间与时区设置问题
在Django的配置文件settings.py中,有两个配置参数是跟时间与时区有关的,分别是TIME_ZONE和USE_TZ 如果USE_TZ设置为True时,Django会使用系统默认设置的时区,即 ...
- WPF的ItemsControl设置数据源以及Binding使用
Student类: using System; using System.Collections.Generic; using System.Linq; using System.Text; usin ...
- 图说超线程技术(Hyper-Threading Technology)
在操作系统中,有多线程(multi-threading)的概念,这很好理解,因为线程是进程最小的调度单位,一个进程至少包含一个线程.本文将介绍CPU特有的超线程技术.简单来说就是,多线程比较软,超线程 ...