简单CMS项目笔记之二:前台页面处理流程
2012-12-05 23:27
411 查看
一:根目录的index.jsp
用户登录到index.jsp
二:IndexAction
通过struts的配置,跳转到此action
这个action中先用static静态块儿做了一些列初始化工作,比如通过Dao构建一个TreeMap保存所有信息的门类等
然后写到request和session中
三:indexTemp.jsp
通过action返回SUCCESS,跳转到了真正显示信息的首页.
其中此页把网页分成了三行,最下边的页尾不用动态include
mainPage参数会去request里找(String)request.getAttribute("mainPage"),找不到的话显示“default.jsp”就行了
找到的话,信息是另一个action也是另一个模块填写进来的,后边再说具体写进来的是什么
用户登录到index.jsp
<%@ page contentType="text/html; charset=gb2312"%> <% response.sendRedirect("goindex.action"); %>然后直接交给负责访问的action处理
二:IndexAction
通过struts的配置,跳转到此action
这个action中先用static静态块儿做了一些列初始化工作,比如通过Dao构建一个TreeMap保存所有信息的门类等
然后写到request和session中
request.setAttribute("allsublist",allsublist); session.put("typeMap",typeMap); session.put("searchMap",searchMap);
三:indexTemp.jsp
通过action返回SUCCESS,跳转到了真正显示信息的首页.
其中此页把网页分成了三行,最下边的页尾不用动态include
<%@ page language="java" contentType="text/html; charset=GBK"%> <%@ taglib uri="/struts-tags" prefix="s2"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String mainPage=(String)request.getAttribute("mainPage"); if(mainPage==null||mainPage.equals("")) mainPage="default.jsp"; %> <html> <head> <title>XXX_CMS信息网</title> <base href="<%=basePath%>"> <link type="text/css" rel="stylesheet" href="css/style.css"> </head> <body background="images/back.gif"> <center> <table border="0" width="920" cellspacing="0" cellpadding="0" bgcolor="white"> <tr><td colspan="2"><jsp:include page="top.jsp"/></td></tr> <tr> <td width="230" valign="top" align="center"><jsp:include page="left.jsp"/></td> <td width="690" height="400" align="center" valign="top" bgcolor="#FFFFFF"><jsp:include page="<%=mainPage%>"/></td> </tr> <tr><td colspan="2"><%@ include file="end.jsp" %></td></tr> </table> </center> </body> </html>
mainPage参数会去request里找(String)request.getAttribute("mainPage"),找不到的话显示“default.jsp”就行了
找到的话,信息是另一个action也是另一个模块填写进来的,后边再说具体写进来的是什么
相关文章推荐
- 简单CMS项目笔记之五:struts标签前台显示
- 简单CMS项目笔记之七:后台登陆登出模块
- BBS项目笔记之二:struts2标签前台实现分页的复用
- Linux IGMP PROXY 学习笔记 之二 igmp proxy的处理流程分析
- 简单CMS项目笔记之三:搜索栏和自定义superAction
- 简单CMS项目笔记之四:信息显示(列表显示和显示具体单项)
- 简单Blog项目笔记之二:首页显示推荐信息
- 会议电视项目积累笔记2(音频处理软件流程及分析).
- Linux icmp 学习笔记 之二 icmp数据处理流程
- 简单CMS项目笔记之八:后台信息分类筛选模块
- 简单CMS项目笔记之九:后台信息修改、审核、删除
- 简单CMS项目笔记之六:信息发布模块
- 简单CMS项目笔记之一:分页类的实现
- ASP.NET 3.5核心编程学习笔记(1):ASP.Net页面请求处理流程
- Web项目中创建简单的错误处理页面
- nodejs+express搭建电影网站之二 -----具体项目结构 开发环境的建立 测试页面流程跑通
- Web项目中创建简单的错误处理页面
- elastic笔记:两种日志处理流程整理
- 一步一步使用Ext JS MVC与Asp.Net MVC 3开发简单的CMS后台管理系统之创建项目
- 简单例子讲述Struts2处理流程