我的项目基于spring boot、Thymeleaf、mysql、html 和 jQuery。我的场景正在获取动态生成的输入框数据和静态输入框数据需要执行并命中@controller。
我想在List EntPropertySub类型中以 JSON 格式发布,这意味着类类型列表,我对如何在 jQuery 中创建列表感到困惑。我试图制作一个对象数组,但似乎是错误的。请指导我。这是一个示例代码
var max;
var blockname;
var floors;
var flatstart;
var flatend;
var blockListPropSub[];
for(max=1;max<=x;max++) {
blockListPropSub[max] = {
blockname = $('#block'+max).val();
floors=$('#floor'+max).val();
flatstart=$('#flats'+max).val();
flatend=$('#flatsend'+max).val();
};
}
Run Code Online (Sandbox Code Playgroud)
这是一个完整的脚本..
$(document).ready(function() {
var max_fields = 10; //maximum input boxes allowed
var wrapper = $("#addingInp"); //Fields wrapper
var add_button = $("#addButton"); //Add button ID
var x = 1; //initlal text box count
$(add_button).click(function(e){ //on add input …Run Code Online (Sandbox Code Playgroud) 我的项目基于spring boot,Thymeleaf,mysql,html和Jquery。
我试图将EntSetCharges类型数据列表发布到@controller,但是它不成功。
java.lang.IllegalStateException:找不到java.util.List的主要构造函数
以前,我使用此错误org.springframework.expression.spel.SpelEvaluationException处理:EL1007E:在null上找不到属性或字段“ chargesName”
现在我在同一页面中又遇到了一个错误
这是我的完整代码...
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
<!-- bootstrap css lib -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<!-- Bootstrap/Jquery CDN library files -->
<script src="https://code.jquery.com/jquery-3.2.1.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- External JQuery Script -->
<!-- <script type="text/javascript" src="../js/formjs/setchargesform.js"></script> -->
<!-- Body Content Goes Here -->
<div class="container">
<form method="post" th:object="${tempEntSetChargesList}" th:action="@{/updatesetcharges}">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Charge Name</th>
<th>Amount</th>
<th>Charge/Unit Type</th>
</tr>
</thead>
<tbody> …Run Code Online (Sandbox Code Playgroud)