informationaddaction.java

来自「一个完整的网络订餐系统」· Java 代码 · 共 42 行

JAVA
42
字号
package com.information.web.action;

import org.apache.struts.action.ActionForward;
import com.common.*;
import com.common.struts.*;
import com.information.dao.InformationDao;
import com.information.form.Information;

public class InformationAddAction extends AbstractAction {
  public InformationAddAction() {
  }

  public ActionForward execute(ActionContext actionContext) throws java.lang.Exception
  {
     SessionContext ctx = (SessionContext) actionContext.getSession().getAttribute(Globals.SESSION_CONTEXT);
     String storeID = null;
     if(null!=ctx) storeID = ctx.getStoreID();
     String systemmanager = (String)actionContext.getSession().getAttribute("systemmanager");
     if(null!=systemmanager) storeID = "kc0305155587174";

     String informationID = actionContext.getParameter("informationID");
     String infoTitle = actionContext.getParameter("infoTitle");
     String infotype = actionContext.getParameter("infotype");
     String infoabstract = actionContext.getParameter("infoabstract");
     String keywords = actionContext.getParameter("keywords");
     String comefrom = actionContext.getParameter("comefrom");
     String author = actionContext.getParameter("author");
     String content = actionContext.getParameter("docContent");


     Information info = new Information(informationID,infoTitle,infotype, infoabstract,
                                        keywords, comefrom, author, content,storeID);

    InformationDao dao = new InformationDao();

    int nRet = dao.inserInformationToDb(info);

    return actionContext.getMapping().findForward("informationAdd");
 }
}

⌨️ 快捷键说明

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