首页>代码>Jsp论坛系统(BBS)源码>/Jsp论坛源码/BBS/src/com/yxq/action/IndexAction.java
package com.yxq.action;

import java.util.List;
import java.util.Vector;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

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

import com.yxq.actionform.ClassForm;
import com.yxq.dao.OpDB;

public class IndexAction extends Action {
	private static Vector searchSQL=null;	
	private static Vector headFace=null;
	
	public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
		HttpSession session=request.getSession();		
		session.setAttribute("mainPage","default.jsp");
		session.setAttribute("backMainPage","default.jsp");
		OpDB myOp=new OpDB();
		
		List classType=myOp.OpClassListShow();
		if(classType!=null&&classType.size()!=0){
			for(int i=0;i<classType.size();i++){
				String classID=((ClassForm)classType.get(i)).getClassId();
				String sql="select * from tb_board where board_classID=?";
				Object[] params={classID};
				List oneboardlist=myOp.OpBoardListShow(sql,params);
				session.setAttribute("class"+classID,oneboardlist);				
			}
		}
		session.setAttribute("classType",classType);		
		session.setAttribute("searchSQL",searchSQL);
		session.setAttribute("headFace",headFace);
		return (mapping.findForward("success"));
	}
	
	static{
		searchSQL=new Vector();
		searchSQL.add(new LabelValueBean("帖子标题","bbs_title"));
		searchSQL.add(new LabelValueBean("帖子内容","bbs_content"));
		searchSQL.add(new LabelValueBean("发表者","bbs_sender"));		
		
		headFace=new Vector();
		for(int i=0;i<22;i++){
			String gif="user"+i+".gif";
			headFace.add(new LabelValueBean("头像"+(i+1),gif));			
		}		
	}
}
最近下载更多
lvhongquan  LV11 2023年12月31日
taoshen95  LV14 2023年12月28日
wubinbin  LV11 2023年4月14日
orenji  LV1 2022年9月19日
yazhiyjs  LV4 2022年8月30日
NCC7470597  LV1 2022年6月15日
yihongyuan  LV13 2022年5月7日
微信网友_5933062541053952  LV2 2022年4月27日
yangyangmei  LV1 2022年4月25日
3332hjjj  LV1 2022年4月15日
最近浏览更多
Rinkia 3月28日
暂无贡献等级
xiaopengzep  LV1 3月25日
wttttts  LV2 1月1日
shenfan  LV1 1月1日
lvhongquan  LV11 2023年12月30日
taoshen95  LV14 2023年12月28日
没有的没有 2023年12月27日
暂无贡献等级
微笑刺客  LV15 2023年12月27日
潘潘123456  LV2 2023年12月24日
shidongxu 2023年12月17日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友