schoolshiptopaction.java

来自「java web开发技术方案宝典」· Java 代码 · 共 45 行

JAVA
45
字号
package com.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.dao.SchoolShipDao;
import com.form.SchoolShipTopicForm;

public class SchoolShipTopAction extends DispatchAction {

	private SchoolShipDao schoolShipDao;

	public SchoolShipDao getSchoolShipDao() {
		return schoolShipDao;
	}

	public void setSchoolShipDao(SchoolShipDao schoolShipDao) {
		this.schoolShipDao = schoolShipDao;
	}

	// 查询留言信息
	public ActionForward querySchoolShipTopicList(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) {
		List<SchoolShipTopicForm> schoolShipTopicList = schoolShipDao
				.getSchoolShipList("from SchoolShipTopicForm");
		request.setAttribute("schoolShipTopicList", schoolShipTopicList);
		return mapping.findForward("querySchoolShipTopicList");
	}

	// 添加留言信息
	public ActionForward addSchoolShipTopic(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) {
		SchoolShipTopicForm schoolShipTopicForm = (SchoolShipTopicForm) form;
		schoolShipDao.addSchoolShip(schoolShipTopicForm);
		return mapping.findForward("addSchoolShipTopic");
	}

}

⌨️ 快捷键说明

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