📄 removeproductmanageaction.java
字号:
/**
*
*/
package cn.bway.foreigntrade.operation.productmanage.action;
import java.io.UnsupportedEncodingException;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import org.hibernate.Transaction;
import cn.bway.common.BwayHibernateException;
import cn.bway.common.WebConstant;
import cn.bway.common.action.BaseAction;
import cn.bway.common.dao.HibernateSessionFactory;
import cn.bway.foreigntrade.operation.guestmanage.form.GuestmanageForm;
import cn.bway.foreigntrade.operation.guestmanage.impl.GuestmanageManagerFactory;
import cn.bway.foreigntrade.operation.productmanage.form.ProductmanageForm;
import cn.bway.foreigntrade.operation.productmanage.impl.ProductmanageManagerFactory;
import cn.bway.myoffice.merchant.impl.MerchantManagerFactory;
/**
* @author Kson
*
*/
public class RemoveProductmanageAction extends BaseAction {
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
ProductmanageForm pForm = (ProductmanageForm) form;
ActionErrors errors = new ActionErrors();
String returnStr = WebConstant.FORWARD_INITPAGE;
String id = request.getParameter("id");
try {
ProductmanageManagerFactory.getProductmanageManager().deleteProductmanage(id);
// request.setAttribute(WebConstant.RETURN_Message,"删除成功!");
// request.setAttribute(WebConstant.RETURN_URL,"queryProvidemana.do");
} catch (BwayHibernateException e) {
returnStr=WebConstant.FORWARD_FAIL;
errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("edu.system.excption",e.getMessage()));
this.saveErrors(request,errors);
e.printStackTrace();
}
return mapping.findForward(returnStr);
}
// // �־û������ʼ��
// try {
// request.setCharacterEncoding("utf-8");
// } catch (UnsupportedEncodingException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// }
// ActionErrors errors = new ActionErrors();
// ProvidemanaForm pForm = (ProvidemanaForm) form;
// Transaction tx = null;
// String returnStr = null;
//
// String pid = request.getParameter("pid");
// try {
// ProvidemanaManagerFactory.ProvidemanaManagerFactory()
// .deleteProvidemana(pid);
//
// returnStr = WebConstant.FORWARD_INITPAGE;
//
// } catch (Exception e) {// �쳣���?ȫ��ת����error.jsp
// errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(
// "edu.system.excption", e.getMessage()));
// this.saveErrors(request, errors);
// tx.rollback();
// e.printStackTrace();
// } finally {
// HibernateSessionFactory.closeSession();
// }
// return mapping.findForward(returnStr);
// }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -