┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ 装 ┊ ┊ ┊ ┊ ┊ 订 ┊ ┊ ┊ ┊ ┊ 线 ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊
毕业设计(论文)说明书
package com.mypack.action;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.mypack.dao.Mp3Dao;
import com.mypack.service.ManagerService; import com.opensymphony.xwork2.ActionSupport; @Component
public class ManagerDelProductAction extends ActionSupport { @Resource
private ManagerService ms; @Resource
private Mp3Dao md;
private String mp3id;
public String execute(){ try{
ms.del(md.get(Integer.valueOf(mp3id))); return SUCCESS; }catch(Exception e){
addFieldError(ERROR, \删除失败, 请重试!\); return INPUT; } }
public String getMp3id() { return mp3id; }
public void setMp3id(String mp3id) { this.mp3id = mp3id; } }
5.2 修改商品代码:
package com.mypack.action;
共 42 页 第 41 页
┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ 装 ┊ ┊ ┊ ┊ ┊ 订 ┊ ┊ ┊ ┊ ┊ 线 ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊
毕业设计(论文)说明书
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.mypack.pojo.Mp3;
import com.mypack.service.ManagerService; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ModelDriven; @Component
public class UpdateAction extends ActionSupport implements ModelDriven
private Mp3 mp3; @Resource
private ManagerService ms;
public String execute(){ ms.update(mp3); return SUCCESS; }
public Mp3 getModel() { return mp3; } }
共 42 页 第 42 页
┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ 装 ┊ ┊ ┊ ┊ ┊ 订 ┊ ┊ ┊ ┊ ┊ 线 ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊ ┊
毕业设计(论文)说明书
共 42 页 第 43 页