Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/354.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
Java 控制器不响应网站上的按钮_Java_Jquery_Html_Spring Mvc_Controller - Fatal编程技术网

Java 控制器不响应网站上的按钮

Java 控制器不响应网站上的按钮,java,jquery,html,spring-mvc,controller,Java,Jquery,Html,Spring Mvc,Controller,我是新到前端的,我的网站上有一个基于thymeleaf的div块,我在其中创建了一个按钮,这是html代码,请关注最后三行的按钮 <form th:action="@{/quiz/nextQuestion}" th:object="${answeredQuestion}" method="post"> <div class="panel-body"> <h3 th:text="${questionStem}">which is the be

我是新到前端的,我的网站上有一个基于thymeleaf的div块,我在其中创建了一个按钮,这是html代码,请关注最后三行的按钮

<form th:action="@{/quiz/nextQuestion}" th:object="${answeredQuestion}" method="post">
    <div class="panel-body">
      <h3 th:text="${questionStem}">which is the best answer</h3>
      <div class="skin skin-square">
        <div class="skin-section">        
          <ul class="list">
            <li th:each="option,rowStat : ${options}">
              <input tabindex="11" type="radio" th:id="${rowStat.index}" name="square-radio"></input>
              <label th:for="${rowStat.index}" th:text="${option.optionString}" >option 1</label>
            </li>
          </ul>
        </div>          
        <script>
            $(document).ready(function(){
              $('.skin-square input').iCheck({
                checkboxClass: 'icheckbox_square-blue',
                radioClass: 'iradio_square-blue',
                increaseArea: '20%'
              });
            });
        </script>
      </div>
    </div>
    <div class="layout-onright-30">
        <button type="button" class="btn default" action="submit">Next One</button>
    </div>
</form>
另外,answeredQuestion是一个没有任何方法或成员的空类

问题是,当我单击下一个按钮时,控制器没有任何响应,我使用的是spring boot,我确信服务和控制器都启动了

有人能帮我吗?
非常感谢。

我在html中犯了一个错误,我想这是我们按照@prabug的建议做的

更改行:

<button type="button" class="btn default" action="submit">Next One</button>
致:


它起作用了。这是一个输入错误。

UI中是否出现了类似表单提交这样的情况?是否可以启用日志记录,并查看表单提交(如果发生)是否能够与相应的控制器匹配?一旦你发现请求是否会被提交,直到它被提交到哪里,你也许可以自己解决这个问题。谢谢@prabug,这对我很好,按照你的建议,我发现答案是没有提交。
<button type="button" class="btn default" action="submit">Next One</button>
<button class="btn default" type="submit">Next One</button>