首页 > 代码库 > Thymeleaf th:action

Thymeleaf th:action

th:attr 任何属性值

<form action="subscribe.html" th:attr="action=@{/subscribe}">
  <fieldset>
    <input type="text" name="email" />
    <input type="submit" value="http://www.mamicode.com/Subscribe me!" th:attr="value=http://www.mamicode.com/#{subscribe.submit}"/>
  </fieldset>
</form>
多个属性一起设置,用逗号隔开

<img src="http://www.mamicode.com/images/gtvglogo.png" th:attr="src=http://www.mamicode.com/@{/images/gtvglogo.png},title=#{logo},alt=#{logo}" />
设置指定属性

复制代码
th:abbr th:accept th:accept-charset
th:accesskey th:action th:align
th:alt th:archive th:audio
th:autocomplete th:axis th:background
th:bgcolor th:border th:cellpadding
th:cellspacing th:challenge th:charset
th:cite th:class th:classid ...
复制代码
<input type="submit" value="http://www.mamicode.com/Subscribe me!" th:value="http://www.mamicode.com/#{subscribe.submit}"/>
<form action="subscribe.html" th:action="@{/subscribe}">
<li><a href="http://www.mamicode.com/product/list.html" th:href="http://www.mamicode.com/@{/product/list}">Product List</a></li>

 

Thymeleaf th:action