⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 catalog.java

📁 新闻发布系统
💻 JAVA
字号:
/*
 * Catalog.java
 *
 * Created on 2007年3月24日, 上午9:31
 */

package News.Struts.Action;

import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;

import News.GUI.ProcessData.List;
/**
 *
 * @author Owner
 * @version
 */

public class Catalog extends Action {
    
    /* forward name="success" path="" */
    private final static String SUCCESS = "success";
    
    /**
     * This is the action called from the Struts framework.
     * @param mapping The ActionMapping used to select this instance.
     * @param form The optional ActionForm bean for this request.
     * @param request The HTTP Request we are processing.
     * @param response The HTTP Response we are processing.
     * @throws java.lang.Exception
     * @return
     */
    public ActionForward execute(ActionMapping mapping, ActionForm  form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        int id=0;
        String catalogName=request.getParameter("catalogName"),showpage=request.getParameter("showPage");
        try{
        id=Integer.parseInt(request.getParameter("ID"));
        }catch(NumberFormatException e){id=1;}
        List l=new List();
        ArrayList al=l.listNewsOfCatalog(showpage,id);
        if(al!=null)
        {
            request.getSession(true).setAttribute("NewsContent",al);
            request.getSession(true).setAttribute("CatalogName",catalogName);
            request.getSession(true).setAttribute("ID",String.valueOf(id));
            request.getSession(true).setAttribute("showPage",String.valueOf(l.getShowPage()));
            request.getSession(true).setAttribute("frontPage",String.valueOf(l.getFrontPage()));
            request.getSession(true).setAttribute("nextPage",String.valueOf(l.getNextPage()));
            request.getSession(true).setAttribute("recordCount",String.valueOf(l.getRecordCount()));
            request.getSession(true).setAttribute("pageCount",String.valueOf(l.getPageCount()));
        return mapping.findForward("catalog");
        }
        else return mapping.findForward("failure");
    }
}

⌨️ 快捷键说明

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