thymeleaf - 为什么我不能将日期值传递给控制器​​?

时间:2016-05-02 19:24:09

标签: spring-mvc thymeleaf

在我的HTML5页面上,我有这段代码摘录。

<body>
    <script type="text/javascript" >

        $(document).ready(function () {

            $('#timepicker4').timepicker({
                format: 'HH:mm'
            });
    </script>
// start of page
    <div class="header">    
        <label th:for="timepicker4" th:value="${hourIntervalStart}">Hour Interval Start: </label>
    </div>
    <div>
        <div class="input-group">                                                   
        <span class="input-group-addon"><i class="fa fa-clock-o"></i></span>
        <input name="hourIntervalStart" th:field="*{hourIntervalStart}" id="timepicker4" class="form-control tp_interval1"></input> 
    </div>
</div>
// rest of page
</body>

问题在于,虽然javascript正确显示时间,但控制器会打印(出于测试目的)null属性的hourIntervalStart值。

正确加载并可从浏览器访问相应的javascript库。

如何正确地将所选值传递给控制器​​?

0 个答案:

没有答案
相关问题