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 如何在“中传递多个表单参数”;th:行动“;使用themleaf_Spring Mvc_Model View Controller_Thymeleaf - Fatal编程技术网

Spring mvc 如何在“中传递多个表单参数”;th:行动“;使用themleaf

Spring mvc 如何在“中传递多个表单参数”;th:行动“;使用themleaf,spring-mvc,model-view-controller,thymeleaf,Spring Mvc,Model View Controller,Thymeleaf,我试图在th:action <form class="form-inline" th:object="${search}" method="get" action="search.html" th:action="@{'/hotels/'+${search.location}+'/'+${search.adults}+'/'+${search.dateCheckOut}+'/'+${search.dateCheckIn}}" id="search-hotel-form">

我试图在
th:action

<form class="form-inline" th:object="${search}" method="get" action="search.html" th:action="@{'/hotels/'+${search.location}+'/'+${search.adults}+'/'+${search.dateCheckOut}+'/'+${search.dateCheckIn}}"  id="search-hotel-form">

    <select class="selectpicker form-control input-lt" th:field="*{location}" id="city">
        <option value="delhi">Delhi</option>
    </select>

    <input type='text' th:field="*{dateCheckIn}" id="datetimepicker1" />

    <input type='text' th:field="*{dateCheckOut}" id="datetimepicker2" />

</form>
但得到错误是错误的

HTTP Status 500 - Request processing failed; nested exception is java.text.ParseException: Unparseable date: "null"
URL部分看起来像这样

http://localhost:8080/hotels/null/0/null/null?location=delhi&dateCheckIn=04%2F07%2F2015+09%3A00&dateCheckOut=04%2F07%2F2015+20%3A00&adults=1

您好,Sanchit,请检查您如何处理pathvariables、表单提交(以及使用的方法)和spring控制器中的@ModelAttribute,我建议您开始使用一些示例应用程序,可能是:您好,Patrick,我能够解决这个问题,基本上是路径结构的问题,调用时变为null()谢谢:-)
http://localhost:8080/hotels/null/0/null/null?location=delhi&dateCheckIn=04%2F07%2F2015+09%3A00&dateCheckOut=04%2F07%2F2015+20%3A00&adults=1