这是我使用Struts2的JSP页面,我有一个带有多个雇员的描述,每个雇员的目标日期分配我想使用JDBC java代码在数据库中保存此详细信息,请告诉我如何在jsp中设置值并获取ActionBean该类是我的JSP代码此代码是动态的您可以添加更多员工,也可以删除更多员工并添加更多描述我想使用“唯一对象”。
<s:form action = "hello" method = "post" enctype = "multipart/form-data">
<div class="MainClass">
<div class="col-12 row">
<div class="col-6 row">
<div class="col-md-12 mb-2 ">
<label for="accidentDesc">Description</label>
<textarea style=" height: auto; padding: 15px 15px 30px; border-radius: 3px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); background: -webkit-linear-gradient(#F9EFAF, #F7E98D)" class="form-control form-control-sm" rows="4" placeholder="Brief Description" ></textarea>
</div>
</div>
<div class="col-6 row M" >
<div class="form-row col-md-12 MainClass_SubClass_"><!--This count is used to maintaince employee div-->
<div class="col-md-6 mb-2">
<label for="accidentDesc">Employee Name/Code</label>
<input class="form-control form-control-sm" id="MainClass__SubClass__empId" name="employee.empCode"/>
</div>
<div class="col-md-3 mb-2">
<label for="accidentDesc">Department</label>
<input type="text" class="form-control form-control-sm" >
</div>
<div class="col-md-3 mb-2">
<label for="accidentDate">Target</label>
<input class="form-control form-control-sm" type="text" />
</div>
</div>
<div class="form-row col-md-12 MainClass_SubClass_"><!--This count is used to maintaince employee div-->
<div class="col-md-6 mb-2">
<label for="accidentDesc">Employee Name/Code</label>
<input class="form-control form-control-sm" id="MainClass__SubClass__empId" name="employee.empCode" />
</div>
<div class="col-md-3 mb-2">
<label for="accidentDesc">Department</label>
<input type="text" class="form-control form-control-sm" >
</div>
<div class="col-md-3 mb-2">
<label for="accidentDate">Target</label>
<input class="form-control form-control-sm" type="text" />
</div>
</div>
</div>
</div>
</div>
<button class="btn btn-success" >Submit</button>
</s:form>