⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smallclassaction.java

📁 医药供应链管理系统
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.captainli.struts.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.captainli.dboperation.SmallclassDA;
import com.captainli.struts.form.SmallclassForm;

/** 
 * MyEclipse Struts
 * Creation date: 11-02-2008
 * 
 * XDoclet definition:
 * @struts.action path="/smallclass" name="smallclassForm" scope="request" validate="true"
 */
public class SmallclassAction extends DispatchAction {
	/*
	 * Generated Methods
	 */

	/** 
	 * 添加产品小类
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 * @throws IOException 
	 */
	public ActionForward addSmallclass(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws IOException {
		//js中解决乱码问题
		response.setContentType("text/html;UTF-8");
		response.setCharacterEncoding("UTF-8");
		
		PrintWriter out = response.getWriter();
		SmallclassForm smallclassForm = (SmallclassForm) form;// TODO Auto-generated method stub
		new SmallclassDA().addSmallclass(smallclassForm);
		out.write("<script language='javascript'>window.alert('添加产品小类成功!');window.location.href='systemPages/smallclass.jsp';</script>");
		out.flush();
		out.close();
		return null;
	}
	/**
	 * 修改产品小类
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws IOException
	 */
	public ActionForward updateSmallclass(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws IOException {
		//js中解决乱码问题
		response.setContentType("text/html;UTF-8");
		response.setCharacterEncoding("UTF-8");
		
		PrintWriter out = response.getWriter();
		SmallclassForm smallclassForm = (SmallclassForm) form;// TODO Auto-generated method stub
		int sc_id = Integer.parseInt(request.getParameter("scid"));
		new SmallclassDA().updateSmallclass(smallclassForm, sc_id);
		out.write("<script language='javascript'>window.alert('修改产品小类成功!');window.location.href='systemPages/smallclass.jsp';</script>");
		out.flush();
		out.close();
		return null;
	}
}

⌨️ 快捷键说明

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