removesmalltagaction.java

来自「这是本人曾经在公司里用的,内部开发框架,基于struts+hibernate今天」· Java 代码 · 共 51 行

JAVA
51
字号
/**
 * 
 */
package cn.bway.foreigntrade.commondata.smalltag.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.commondata.smalltag.form.SmalltagForm;
import cn.bway.foreigntrade.commondata.smalltag.impl.SmalltagManagerFactory;
import cn.bway.myoffice.merchant.impl.MerchantManagerFactory;

/**
 * @author Kson
 * 
 */
public class RemoveSmalltagAction 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) {
		SmalltagForm pForm = (SmalltagForm) form;
		ActionErrors errors = new ActionErrors();
		String returnStr = WebConstant.FORWARD_INITPAGE;
		String id = request.getParameter("id");
		try {
			SmalltagManagerFactory.getSmalltagManager().deleteSmalltag(id);
		} 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);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?