Nathing
mingwjj
全部博文(111)
j2se(1)
hibernate(0)
2016年(2)
2015年(1)
2014年(31)
2012年(2)
2011年(9)
2010年(36)
2009年(30)
kgdjszx
备案出行
hzlzy
zhaoyh
zyd10137
wddwr730
2_gougou
shenhp
yingyife
分类: Java
2010-11-01 10:40:54
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="" xmlns="" xmlns:web="/web-app_2_5.xsd" xsi:schemaLocation=" /web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>serializationObject</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>2</param-value> </init-param> <init-param> <param-name>detail</param-name> <param-value>2</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <!-- Standard Action Servlet Mapping --> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:beans.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> </web-app>
<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" ""> <struts-config> <form-beans> <form-bean name="championsForm" type="com.jj.serializ.web.actionForm.ChampionsForm" /> </form-beans> <action-mappings> <action path="/champions" type="com.jj.serializ.web.action.ChampionsAction" name="championsForm" scope="request" parameter="method"> <forward name="list" path="/list.jsp"></forward> </action> </action-mappings> <controller processorClass="org.springframework.web.struts.AutowiringRequestProcessor" /> </struts-config>
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="" xmlns:xsi="" xmlns:aop="" xmlns:tx="" xsi:schemaLocation=" /spring-beans-2.0.xsd /spring-aop-2.0.xsd /spring-tx-2.0.xsd"> <bean id="reportDAO" class="com.jj.serializ.dao.impl.ReportDAOImpl"/> <bean id="reportManager" class="com.jj.serializ.manager.impl.ReportManagerImpl"> <property name="reportDAO" ref="reportDAO"></property> </bean> <bean id="champions" class="com.jj.serializ.web.action.ChampionsAction"> <property name="reportManager" ref="reportManager"></property> </bean> </beans>
public class ChampionsAction extends DispatchAction { private ReportManager reportManager; public ActionForward list(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { reportManager.save(); List<Report> list = reportManager.load(); System.out.println(list.size()); request.setAttribute("list", list); return mapping.findForward("list"); } public void setReportManager(ReportManager reportManager) { this.reportManager = reportManager; } }
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ""> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <table border="1" align="center" cellpadding="1" cellspacing="0"> <tr bgcolor="#EFF3F7"> <td><b>abs_index</b></td> <td><b>day_index</b></td> <td><b>name</b></td> <td><b>province</b></td> <td><b>sex</b></td> <td><b>reportVersion</b></td> </tr> <c:forEach items="${list}" var="report"> <tr> <td>${report.abs_index}</td> <td>${report.day_index}</td> <td>${report.name}</td> <td>${report.province}</td> <c:if test="${report.sex eq 0}"> <td>女</td> </c:if> <c:if test="${report.sex eq 1}"> <td>男</td> </c:if> <td>${report.reportVersion}</td> </tr> </c:forEach> </table> </body> </html>
上一篇:Java序列化算法透析
下一篇:Ibtis_spring
chinaunix网友2010-11-01 17:51:29
很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com
登录 注册