- 浏览: 1525259 次
- 性别:
- 来自: 杭州
文章分类
- 全部博客 (525)
- SEO (16)
- JAVA-EE-Hibernate (6)
- JAVA-EE-Struts (29)
- JAVA-EE-Spring (15)
- Linux (37)
- JAVA-SE (29)
- NetWork (1)
- CMS (14)
- Semantic Research (3)
- RIA-Flex (0)
- Ajax-Extjs (4)
- Ajax-Jquery (1)
- www.godaddy.com (0)
- SSH (34)
- JavaScript (6)
- SoftwareEngineer (9)
- CMMI (0)
- IDE-Myeclipse (3)
- PHP (1)
- Algorithm (3)
- C/C++ (18)
- Concept&Items (2)
- Useful WebSite (1)
- ApacheServer (2)
- CodeReading (1)
- Socket (2)
- UML (10)
- PowerDesigner (1)
- Repository (19)
- MySQL (3)
- SqlServer (0)
- Society (1)
- Tomcat (7)
- WebService (5)
- JBoss (1)
- FCKeditor (1)
- PS/DW/CD/FW (0)
- DesignPattern (11)
- WebSite_Security (1)
- WordPress (5)
- WebConstruction (3)
- XML|XSD (7)
- Android (0)
- Project-In-Action (9)
- DatabaseDesign (3)
- taglib (7)
- DIV+CSS (10)
- Silverlight (52)
- JSON (7)
- VC++ (8)
- C# (8)
- LINQ (1)
- WCF&SOA (5)
- .NET (20)
- SOA (1)
- Mashup (2)
- RegEx (6)
- Psychology (5)
- Stock (1)
- Google (2)
- Interview (4)
- HTML5 (1)
- Marketing (4)
- Vaadin (2)
- Agile (2)
- Apache-common (6)
- ANTLR (0)
- REST (1)
- HtmlAnalysis (18)
- csv-export (3)
- Nucth (3)
- Xpath (1)
- Velocity (6)
- ASP.NET (9)
- Product (2)
- CSS (1)
最新评论
-
lt26w:
理解成门面模式应该比较容易明白吧
FacadePattern-Java代码实例讲解 -
lt26w:
看下面的例子比较明白.
FacadePattern-Java代码实例讲解 -
javaloverkehui:
这也叫文档,别逗我行吗,也就自己看看。
HtmlCleaner API -
SE_XiaoFeng:
至少也应该写个注释吧。
HtmlCleaner API -
jfzshandong:
...
org.springframework.web.filter.CharacterEncodingFilter 配置
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
&
发表评论
-
java.lang.ClassCastException: java.lang.Integer
2010-01-09 12:55 1388java.lang.ClassCastException: j ... -
Error:org.springframework.web.context.ContextLoaderListener
2010-01-06 21:17 8689Error con ... -
Error configuring application listener of class org.springframework.web.context.
2010-01-06 21:11 20121急!!tomcat启动报错:Error configuring ... -
Cannot find bean org.apache.struts.taglib.html.BEAN
2009-12-29 14:29 1305Cannot find bean org.apache.str ... -
attempt to create delete event with null entity
2009-12-29 11:07 4688attempt to create delete event ... -
懒加载异常org.hibernate.LazyInitializationException: could not initialize proxy - no
2009-12-28 20:44 20209错误页面提示 could n ... -
getHibernateTemplate.load() 和get()之间的区别
2009-12-28 20:16 18751. getHibernateTemplate.load() ... -
getSession()与getHibernateTemplate()区别
2009-12-28 20:13 2567getSession()与getHibernateTempla ... -
使用Hibernate持久层 --- 2 出现的问题与解决方法总结
2009-12-28 15:04 1209使用Hibernate持久层 --- 2 出现的问题与解决方法 ... -
java.lang.NullPointerException DAO
2009-12-28 15:02 1858~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... -
JSTL1.1中要用的jar--standard.jar jstl.jar
2009-12-09 00:35 4078gg -
Jsessionid
2009-12-07 16:22 1289(1) 这是一个 ... -
spring有三种启动方式,
2009-12-07 15:21 2473spring有三种启动方式,使用 ... -
ContextLoaderListener VS. ContextLoaderServlet
2009-12-07 15:20 3557一旦ContextLoaderServlet或Cont ... -
ERRORcheck whether you have multiple ContextLoader* definitions in your web.xml!
2009-12-07 15:17 6274ERROR:check whether you have mu ... -
从tomcat 迁移到 WebSphere 经验总结(修改)
2009-12-07 15:08 2456从tomcat 迁移到 WebSphere ... -
CGlib & asm
2009-12-07 15:01 2722缺少包出现的错误信息:cglib-2.1.3.jar CGL ... -
Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTup
2009-12-07 14:57 5443Unable to instantiate default t ... -
asm.jar的冲突问题
2009-12-07 14:53 1494No configuration found. Confi ... -
异常:ERROR [org.hibernate.proxy.BasicLazyInitializer] - CGLIB Enhancement failed..
2009-12-07 14:25 1815用MyEclipse6.0写了一个spri ...
相关推荐
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 ...
轻量级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 +个属性可以自动...
AJAX实现用户登录注册(Struts+Spring+Hibernate+Ajax框架) AJAX实现用户登录注册(Struts+Spring+Hibernate+Ajax框架) AJAX实现用户登录注册(Struts+Spring+Hibernate+Ajax框架)