2017-04-22 37 views
0

这是我在我的Spring应用程序中使用的jsp代码。春季使用标签标签有什么用途

<form:label path="username">Enter your user-name</form:label> 
      <form:input id="username" name="uName" path="" /><br> 
      <form:label path="username">Please enter your password</form:label> 
      <form:password id="password" name="password" path="" /><br> 
      <input type="submit" value="Submit" /> 

有人可以请我解释一下标签路径属性的用法。它究竟做了什么。因为当我打开这个路径值时,它会在显示时抛出一个错误。有人能解释我是什么吗??

+0

[春季路径属性(可能的重复http://stackoverflow.com/questions/17647050/path-attribute-in-spring) – BackSlash

+0

http://stackoverflow.com/questions/21593988/what-is-the-advantage-of-formlabel-tag-in-spring –

+0

可能重复[什么是Spring中form:label标签的优点?](http://stackoverflow.com/questions/21593988/what-is-the-advantage-of-formlabel-tag-in-spring) –

回答

0

路径标签用于绑定数据。

由于标签是不是输入,你可以使用标签“的”属性代替,如:

<label for="inputField"><spring:message code="label.input"/></label>