placardmanagecontroller.java
来自「网上购物商城」· Java 代码 · 共 42 行
JAVA
42 行
package com.lzw.manager;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;
import com.lzw.dao.Dao;
import com.lzw.manager.form.SuperTypeForm;
public class PlacardManageController extends SimpleFormController {
private Dao dao;
public PlacardManageController() {
setCommandClass(SuperTypeForm.class);
}
protected ModelAndView onSubmit(Object command) throws Exception {
SuperTypeForm form = (SuperTypeForm) command;
String[] delids = form.getDelid();
String message = null;
if (delids.length > 0) {
String ID = "";
for (int i = 0; i < delids.length; i++) {
ID = ID + delids[i] + ",";
}
ID = ID.substring(0, ID.length() - 1);
if (!dao.delPlacard(ID)) {
message = "删除失败!";
} else {
message = "删除成功!";
}
} else {
message = "您的操作有误!";
}
return new ModelAndView(getSuccessView(), "message", message);
}
public Dao getDao() {
return dao;
}
public void setDao(Dao dao) {
this.dao = dao;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?