?? mainindex.java
字號:
/*
* MainIndex.java
*
* Created on 2007年3月22日, 上午8:32
*/
package News.Struts.Action;
import News.ProcessData.SingleRecordModel;
import News.Struts.ActionForm.SiteSettingActionForm;
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.Data.Catalog;
import News.Common.News;
import java.util.*;
import News.GUI.ProcessData.List;
/**
*
* @author Owner
* @version
*/
public class MainIndex extends Action {
/**
* 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 {
List l=new List();
ArrayList title=new ArrayList();
ArrayList news=new ArrayList();
ArrayList links=new ArrayList();
ArrayList ca=l.getAllNewsCatalogs();
Iterator li=ca.listIterator();
while(li.hasNext())
{
Catalog catalog=(Catalog)li.next();
title.add(catalog);
Iterator lt=l.getAllNews(catalog.getId(),5,catalog.getTitle()).listIterator();
while(lt.hasNext())
{
News n=(News)lt.next();
news.add(n);
}
}
links=l.getAllLinks();
if(!links.isEmpty())
{
request.getSession(true).setAttribute("link",links);
}
SiteSettingActionForm site=l.SiteSettingRecord();
if(site!=null)
{
request.getSession(true).setAttribute("site",site);
}
ArrayList alt=l.getAllNotices();
if(!alt.isEmpty())
{
request.getSession(true).setAttribute("notice",alt);
}
request.getSession(true).setAttribute("title",title);
request.getSession(true).setAttribute("news",news);
return mapping.findForward("index");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -