点批量删除没反应
Message.xml
dao层
public void deleteBatch(List<Integer> ids){
try {
sqlSession = dbAccess.getSqlSession();
sqlSession.delete("Message.deleteBatch",ids);
sqlSession.commit();
} catch (IOException e) {
e.printStackTrace();
} finally{
if(sqlSession!=null){
sqlSession.close();
}
}
service层
public void deleteBatch(String[] ids){
MessageDao messageDao = new MessageDao();
List<Integer> idList = new ArrayList<Integer>();
for (String id : ids) {
idList.add(Integer.valueOf(id));
}
messageDao.deleteBatch(idList);
}
servlet:
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String[] ids = request.getParameterValues("id");
MaintainService ms = new MaintainService();
ms.deleteBatch(ids);
request.getRequestDispatcher("/List").forward(request, response);
}
jsp:
js:
function deleteBatch(basePath) {
$("#mianForm").attr("action",basePath+"DeleteBatchServlet.action");
$("#mainForm").submit();
}
实在不知道哪里错了,点删除的时候没有反应,地址栏也没有变化