Spring mvc 如何通过电子邮件发送参数?
我有一个控制器说Spring mvc 如何通过电子邮件发送参数?,spring-mvc,thymeleaf,Spring Mvc,Thymeleaf,我有一个控制器说 @RequestMapping(value = "/search/{lastname}", method = RequestMethod.GET) public String searchAlpha(@PathVariable String lastname) { log.info("-------------------"); log.info(lastname); return "welcome"; } 还有
@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>
搜寻
如何在不使用模型的情况下使发送为参数?找到了方法
<form action="#" th:action="@{/search}" method="get" class="form-horizontal">
<div class = "form-group">
<input name="lastname" id="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>
</form>
@RequestMapping(value = "/search", method = RequestMethod.GET)
public String searchAlpha(@RequestParam String lastname) {
log.info(lastname);
return "welcome";
}