01 | package com.yxq.action; |
02 |
03 | import java.util.List; |
04 | import java.util.Vector; |
05 |
06 | import javax.servlet.http.HttpServletRequest; |
07 | import javax.servlet.http.HttpServletResponse; |
08 | import javax.servlet.http.HttpSession; |
09 |
10 | import org.apache.struts.action.Action; |
11 | import org.apache.struts.action.ActionForm; |
12 | import org.apache.struts.action.ActionForward; |
13 | import org.apache.struts.action.ActionMapping; |
14 | import org.apache.struts.util.LabelValueBean; |
15 |
16 | import com.yxq.actionform.ClassForm; |
17 | import com.yxq.dao.OpDB; |
18 |
19 | public class IndexAction extends Action { |
20 | private static Vector searchSQL= null ; |
21 | private static Vector headFace= null ; |
22 | |
23 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { |
24 | HttpSession session=request.getSession(); |
25 | session.setAttribute( "mainPage" , "default.jsp" ); |
26 | session.setAttribute( "backMainPage" , "default.jsp" ); |
27 | OpDB myOp= new OpDB(); |
28 | |
29 | List classType=myOp.OpClassListShow(); |
30 | if (classType!= null &&classType.size()!= 0 ){ |
31 | for ( int i= 0 ;i<classType.size();i++){ |
32 | String classID=((ClassForm)classType.get(i)).getClassId(); |
33 | String sql= "select * from tb_board where board_classID=?" ; |
34 | Object[] params={classID}; |
35 | List oneboardlist=myOp.OpBoardListShow(sql,params); |
36 | session.setAttribute( "class" +classID,oneboardlist); |
37 | } |
38 | } |
39 | session.setAttribute( "classType" ,classType); |
40 | session.setAttribute( "searchSQL" ,searchSQL); |
41 | session.setAttribute( "headFace" ,headFace); |
42 | return (mapping.findForward( "success" )); |
43 | } |
44 | |
45 | static { |
46 | searchSQL= new Vector(); |
47 | searchSQL.add( new LabelValueBean( "帖子标题" , "bbs_title" )); |
48 | searchSQL.add( new LabelValueBean( "帖子内容" , "bbs_content" )); |
49 | searchSQL.add( new LabelValueBean( "发表者" , "bbs_sender" )); |
50 | |
51 | headFace= new Vector(); |
52 | for ( int i= 0 ;i< 22 ;i++){ |
53 | String gif= "user" +i+ ".gif" ; |
54 | headFace.add( new LabelValueBean( "头像" +(i+ 1 ),gif)); |
55 | } |
56 | } |
57 | } |

lvhongquan LV11
2023年12月31日
taoshen95 LV16
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日

ChanLain LV2
3月3日
微信网友_7300409508155392
2024年12月17日
暂无贡献等级
短巷拥猫 LV12
2024年10月22日
Rinkia
2024年3月28日
暂无贡献等级
xiaopengzep LV1
2024年3月25日
wttttts LV2
2024年1月1日
shenfan LV1
2024年1月1日
lvhongquan LV11
2023年12月30日
taoshen95 LV16
2023年12月28日
没有的没有
2023年12月27日
暂无贡献等级