- 浏览: 151279 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
陈碧滔:
java获取工程目录路径 -
stevenjohn:
楼主能上传一下源代码吗?
ActiveMQ5.0实战三:使用Spring发送,消费topic和queue消息 -
指挥家:
讲的很好!
Foxmail6收发Web mail邮箱邮件实现原理 -
azhqiang:
谢谢你啊。呵呵
flex最全的表单验证
1.web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<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,/WEB-INF/struts-config-form.xml,/WEB-INF/struts-config-action.xml
</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>120</session-timeout>
</session-config>
<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
<!-- Tag Library Descriptors-->
<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-bean.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-bean.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-html.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-html.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-logic.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-logic.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-nested.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-nested.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-template.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-template.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-tiles.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-tiles.tld
</taglib-location>
</taglib>
</jsp-config>
</web-app>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<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,/WEB-INF/struts-config-form.xml,/WEB-INF/struts-config-action.xml
</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>120</session-timeout>
</session-config>
<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
<!-- Tag Library Descriptors-->
<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-bean.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-bean.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-html.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-html.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-logic.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-logic.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-nested.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-nested.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-template.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-template.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-tiles.tld</taglib-uri>
<taglib-location>
/WEB-INF/tld/struts-tiles.tld
</taglib-location>
</taglib>
</jsp-config>
</web-app>
2.applicationContext-persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- 配置数据源 -->
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>jdbc:oracle:thin:@localhost:1521:ora9i</value>
</property>
<property name="username">
<value>tom</value>
</property>
<property name="password">
<value>tom</value>
</property>
</bean>
<!-- 配置Hibernate -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="mappingResources">
<list>
<value>com/example/entity/User.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<!-- 配置事务 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<bean id="transactionInterceptor"
class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="transactionManager" />
<property name="transactionAttributes">
<props>
<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<bean id="transactionProxyCreator"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="proxyTargetClass" >
<value>true</value>
</property>
<property name="beanNames">
<list>
<value>*Service</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>transactionInterceptor</value>
</list>
</property>
</bean>
</beans>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- 配置数据源 -->
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>jdbc:oracle:thin:@localhost:1521:ora9i</value>
</property>
<property name="username">
<value>tom</value>
</property>
<property name="password">
<value>tom</value>
</property>
</bean>
<!-- 配置Hibernate -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="mappingResources">
<list>
<value>com/example/entity/User.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<!-- 配置事务 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<bean id="transactionInterceptor"
class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="transactionManager" />
<property name="transactionAttributes">
<props>
<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<bean id="transactionProxyCreator"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="proxyTargetClass" >
<value>true</value>
</property>
<property name="beanNames">
<list>
<value>*Service</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>transactionInterceptor</value>
</list>
</property>
</bean>
</beans>
3.applicationContext-action.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- example -->
<bean name="/login" class="com.example.actions.LoginAction">
<property name="userService">
<ref bean="userService" />
</property>
</bean>
</beans>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- example -->
<bean name="/login" class="com.example.actions.LoginAction">
<property name="userService">
<ref bean="userService" />
</property>
</bean>
</beans>
4.applicationContext-service.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- example -->
<bean id="userService"
class="com.example.service.UserService">
<property name="userDAO">
<ref bean="userDAO" />
</property>
</bean>
</beans>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- example -->
<bean id="userService"
class="com.example.service.UserService">
<property name="userDAO">
<ref bean="userDAO" />
</property>
</bean>
</beans>
5.applicationContext-dao.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- example -->
<bean id="userDAO" class="com.example.dao.UserDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
</beans>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- example -->
<bean id="userDAO" class="com.example.dao.UserDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
</beans>
6.struts-config.xml
&
发表评论
-
ActiveMQ5.0实战三:使用Spring发送,消费topic和queue消息
2010-11-02 10:05 3075简介 实战一 , 实战二介绍了ActiveMQ的基本概念和配 ... -
SSH整合全步骤
2010-08-04 21:53 1053安装所需软件环境: 1、首先安装JDK,配置Java环境 ... -
MyEclipse开发SSH(Struts+Spring+Hibernate)入门 【有图】
2010-08-04 21:52 1425MyEclipse开发SSH(Struts+Spring+Hi ... -
struts2.0.14+hibernate3.2+spring2.5.6+tomcat6.0+mysql5.0整合全过程
2010-08-04 21:51 1453这里为什么使用struts2.0.14这个版本呢??请看官网的 ... -
hibernate配置文件详解
2010-08-04 21:47 939hibernate.cfg.xml文件详解 ... -
Struts配置文件struts-config.xml
2010-08-04 21:46 806struts-config.xml是Struts的核心文件,该 ... -
java笔试试题(转)
2010-08-02 23:06 870第一,谈谈final, finally ... -
严重: Null component Catalina:type=JspMonitor,name=jsp,..J2EEApplication=none,J2EE
2010-07-27 23:46 15702010-1-7 10:20:53 org.apache.ca ... -
java.util.Date 24小时格式
2010-06-26 13:40 1760在写程序的时候,不小心写了下面的 Jav ... -
java文件操作大全
2010-06-09 23:49 814一.获得控制台用户输入的信息 Java代码 ... -
JAVA复制文件的操作
2010-06-09 23:46 2771Java代码 /** * 复制整个文件夹内 ... -
日期类加减及Java中日期类操作算法大全
2010-06-02 19:31 14651.计算某一月份的最大天数 1Calendar time= ... -
为什么要设置JAVA_HOME、Path、CLASSPATH、CATALINA_HOME
2010-06-02 19:22 1509首先得介绍下面几个参数的作用: current direct ... -
【转】StringUtils
2010-05-06 23:39 1117从代码中我们可以大致了解到这个 StringUtils 类简单 ...
相关推荐
DWR+Struts+spring+hibernate的订货系统,自己添加的dwr功能
简单struts+spring+hibernate搭建,配置,适合初学者
2. **配置文件**:struts-config.xml定义Struts的配置,spring-beans.xml管理Spring的bean,hibernate.cfg.xml配置Hibernate的数据库连接,可能还有实体类的映射文件(hbm.xml或使用注解)。 3. **JSP页面**:展示...
项目原型:Struts2.3.16 + Spring4.1.1 + Hibernate4.3.6 二、 项目目的: 整合使用最新版本的三大框架(即Struts2、Spring4和Hibernate4),搭建项目架构原型。 项目架构原型:Struts2.3.16 + Spring4.1.1 + ...
SSH整合的关键在于配置文件,包括Struts 2的struts.xml、Spring的applicationContext.xml和Hibernate的hibernate.cfg.xml。这些文件定义了各组件之间的关系和行为。例如,struts.xml中配置Action类及其结果视图,...
基于struts+spring+hibernate+oracle的移动ssh项目源码 基于struts+spring+hibernate+oracle的移动ssh项目源码 基于struts+spring+hibernate+oracle的移动ssh项目源码 基于struts+spring+hibernate+oracle的移动ssh...
基于spring实现的网上订餐系统(struts+spring+hibernate+SQL Server) 基于spring实现的网上订餐系统(struts+spring+hibernate+SQL Server) 基于spring实现的网上订餐系统(struts+spring+hibernate+SQL Server) 基于...
网上订餐系统(struts+spring+hibernate).rar 网上订餐设计主要采用采用MYSQL数据库进行数据表的设计,利用JSP的动态生成页面编程技术, 实现了用网络展示餐饮信息、浏览餐饮页面、注册客户、更改客户信息;同时,...
基于JavaWeb实现的图书管理系统(struts+spring+hibernate+SQL Server) 基于JavaWeb实现的图书管理系统(struts+spring+hibernate+SQL Server) 基于JavaWeb实现的图书管理系统(struts+spring+hibernate+SQL Server) ...
SSH(Struts+Spring+Hibernate)是一个经典的Java Web开发框架,用于构建高效、可扩展的企业级应用程序。这个教务管理信息系统是基于SSH框架实现的,提供了完整的源代码,可以直接运行,便于开发者学习和参考。 **...
SSH三大框架,即Struts、Spring和Hibernate,是Java Web开发中的常用技术组合,它们各自负责不同的职责:Struts作为MVC模式中的Controller层,处理用户请求并转发到相应的业务逻辑;Spring则作为核心容器,负责依赖...
Struts1.2+Spring2.0+Hibernate3.1Struts1.2+Spring2.0+Hibernate3.1Struts1.2+Spring2.0+Hibernate3.1Struts1.2+Spring2.0+Hibernate3.1
在这个项目中,"struts+spring+hibernate(mysql)用户登录及文件上传",开发者整合了这三个框架,并结合MySQL数据库实现了一个完整的用户管理系统,包括用户身份验证和文件上传功能。 首先,Struts是MVC(Model-View...
总的来说,这个"struts2+spring2.5+hibernate3.2整合完整项目"提供了一个完整的开发实例,涵盖了前端到后端,以及数据库的各个环节。对于学习者而言,可以深入理解这三大框架的协同工作,提升Java Web开发技能。而...
Struts 2+Spring 3+Hibernate框架技术精讲与整合案例Struts 2+Spring 3+Hibernate框架技术精讲与整合案例Struts 2+Spring 3+Hibernate框架技术精讲与整合案例Struts 2+Spring 3+Hibernate框架技术精讲与整合案例...
农业网站 (ssh) struts 2 +spring+ hibernate农业网站 (ssh) struts 2 +spring+ hibernate农业网站 (ssh) struts 2 +spring+ hibernate农业网站 (ssh) struts 2 +spring+ hibernate农业网站 (ssh) struts ...
标题和描述中指出的文档《Struts+Spring+Hibernate开发实例.pdf》包含了关于这三个流行的Java开源框架结合使用的示例代码和相关知识点。Struts负责视图与控制器部分,Spring负责业务逻辑层及依赖注入,Hibernate负责...
轻量级JavaEE企业应用实战_Struts2+Spring3+Hibernate整合开发_第3版.part1
Struts 2+Spring 3+Hibernate框架技术精讲与整合案例3Struts 2+Spring 3+Hibernate框架技术精讲与整合案例3Struts 2+Spring 3+Hibernate框架技术精讲与整合案例3
struts2+spring2.5+hibernate3.2 + freemarker 全新功能实现的增删改查+freemarker 摸版 struts2 的方式自己去看简单。 spring2.5 是用注释来注入 hibernate3.2 是用ejb3注解映射关系 hibernate3 +个属性可以自动...