程序/qyrl/src/com/wy/action/CjAction.java

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.wy.action;


import java.util.List;

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.wy.dao.ObjectDao;
import com.wy.form.CjForm;
import com.wy.form.TrainForm;

public class CjAction extends DispatchAction {
	private ObjectDao objectDao;

	public ObjectDao getObjectDao() {
		return objectDao;
	}

	public void setObjectDao(ObjectDao objectDao) {
		this.objectDao = objectDao;
	}

	// 奖惩察看操作
	public ActionForward queryCj(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		String information = "from CjForm order by id desc";
		if (request.getParameter("type") != null) {
			String type = request.getParameter("type").trim();
			information = "from CjForm where cj_type=" + type
					+ " order by id desc";
			
			request.setAttribute("type", type);
		}
		System.out.println("information:"+information);
		List list = objectDao.getObjectList(information);
		request.setAttribute("list", list);
		return mapping.findForward("queryCj");
	}

	// 删除奖惩操作
	public ActionForward deleteCj(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		String id = request.getParameter("id");
		System.out.println(id);
		if (id != null) 
		{
			CjForm cjForm = (CjForm) objectDao.getObjectForm("from CjForm where id='" + id + "'");
			System.out.println(cjForm.getCj_title());
			
			this.objectDao.deleteObjectForm(cjForm);
		}
		return this.queryCj(mapping, form, request, response);
	}

后面还有 19 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。