Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring mvc 如何通过电子邮件发送参数?_Spring Mvc_Thymeleaf - Fatal编程技术网

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";
    }