schoolshiprepaction.java

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

JAVA
41
字号
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.SchoolShipReplyForm;
import com.form.SchoolShipTopicForm;

public class SchoolShipRepAction extends DispatchAction {
	private SchoolShipDao schoolShipDao;

	public SchoolShipDao getSchoolShipDao() {
		return schoolShipDao;
	}

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

	// 添加回复信息
	public ActionForward execute(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) {
	
		SchoolShipReplyForm replyForm = (SchoolShipReplyForm) form;
		SchoolShipTopicForm topicForm = new SchoolShipTopicForm();
		topicForm.setId(new Integer(request.getParameter("topicId")));
		replyForm.setTbSchoolShipTopic(topicForm);
		schoolShipDao.addSchoolShipReply(replyForm);
		return mapping.findForward("addSchoolShipRep");
	}
}

⌨️ 快捷键说明

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