0
我有一个控制器说,如何通过thymleaf发送参数?
@RequestMapping(value = "/search/{lastname}", method = RequestMethod.GET)
public String searchAlpha(@PathVariable String lastname) {
log.info("-------------------");
log.info(lastname);
return "welcome";
}
和一个表单
<form action="#" th:action="@{/search/__${lastName}__}" method="get" class="form-horizontal">
<div class = "form-group">
<input th:field="*{lastName}" type="text" class="form-control" placeholder="Last Name" />
<span class="input-group-btn">
<button class="btn btn-default" type="submit">Search</button>
</span>
</div>
如何使发送的参数,而无需使用模式?