Publishing.java~4~
上传用户:toby828
上传日期:2015-06-26
资源大小:8558k
文件大小:2k
- package com.action;
- import org.apache.struts.action.ActionMapping;
- import org.apache.struts.action.ActionForm;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import org.apache.struts.action.ActionForward;
- import com.actionForm.PublishingForm;
- import org.apache.struts.action.Action;
- import com.dao.PublishingDAO;
- public class Publishing extends Action {
- private PublishingDAO pubDAO = null;
- public Publishing() {
- this.pubDAO = new PublishingDAO();
- }
- public ActionForward perform(ActionMapping mapping, ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) {
- PublishingForm publishingForm = (PublishingForm) form;
- String action =request.getParameter("action");
- System.out.println("nbook*********************action="+action);
- if(action==null||"".equals(action)){
- request.setAttribute("error","您的操作有误!");
- return mapping.findForward("error");
- }else if("bookQuery".equals(action)){
- return bookQuery(mapping,form,request,response);
- }
- request.setAttribute("error","操作失败!");
- return mapping.findForward("error");
- }
- /***********************查询全部图书信息**************************/
- private ActionForward bookQuery(ActionMapping actionMapping,ActionForm actionForm,HttpServletRequest servletRequest,HttpServletResponse servletResponse){
- String str=null;
- servletRequest.setAttribute("book",pubDAO.query(str));
- return actionMapping.findForward("pubQuery");
- }
- }