good framework naturally forms the guidance of how code is distributed. More importantly, the framework eases the pain of developers writing code like the persistence layer from scratch, and makes them focus on the application logic that is important to the customer.This article will discuss how to combine several well-known frameworks for loose-coupling purposes, how to build your architecture, and how to keep your application tiers consistent. The challenge is to combine these frameworks so t
doesn't mean that spring and struts integrateIt's a spring HelloWorld.Next, we need to add a listener to the Web. xmlNew Web. xmlclass>org.springframework.web.context.contextloaderlistenerclass> class>org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilterclass> /*And then join in a Struts2-spring-plugin-2.1.8.1.jarChange the class property of the
Today, with Maven, the Struts2, spring, hibernate integration is implemented.There were a lot of mistakes in the middle. Most of these are caused by an error in the configuration file. To integrate here:Note: Here we implement a login function. The user enters the user name and password from the JSP page, the server verifies its correctness, jumps to the different page according to the correct or not.First,
Project directory structure:
Project StructureStep 1: Prepare the jar package
The above are all jar packages required by springmvc + hibernate.Copy all jar packages to the lib directory of the web project.Step 2: configure the file
Copy and modify files From HibernateFirst, go to the ETC folder from the project folder in Hibernate and copy the two files to the classpath folder,
Figure 2-1
## HypersonicSQLdataSource.password=dataSource.username=root
Originally wanted to write down spring+springmvc+hibernate integration of the article temporarily do not write the direct attached source code, there is a need for direct download to see it. There are previous articles in the SPRINGMVC source code before the article is simply said to build the environment to access the page successfully. This source code has simulated additions and deletions and file upload
(function, Class), has its own highly relevant responsibilities, that is, several tasks in this responsibility are highly correlated. Each module (function, Class) will never accomplish tasks unrelated to its own responsibilities.So how to construct a low-coupling, high cohesion system can, one of the most popular framework structure of the struts+spring+hibernate for us to provide convenience. Using strut
Label:Integrate hibernateIntegrate what?
An IOC container to manage Hibernate's sessionfactory
Let hibernate use a declarative transaction on spring
?Add Hibernate driver Package firstNew Hibernate.cfg.xmlConfigure basic properties for Hibernate
The data source needs to be configured in the I
The significance and essence of SSH (struts, spring, and hibernate) Integration
How hibernate worksPrinciple:1. Read and parse the configuration file2. Read and parse the ing information and create sessionfactory3. Open sesssion4. Create transaction Transation5. Persistent operations6. Submit the transaction7. Disable session8. Disable sesstionfactoryWhy
Controller control page Jump processing foreground background data interactive access ServiceDAO Layer: @Repository Database access layer additions and deletions to the JPA specification of the Hibernate JAP warehouse JPA Automatic parsing method name using @query (sql| | HqlDomaon layer: The entity bean is the table of the database in which the @entity @Table correspondence between the PojoService Layer: @Service Implementation some JPA can parse wit
Why use the Hibernate framework? This is already mentioned in the hibernate introduction blog.
Since the Hibernate framework is used to access and manage the persistent layer, why does spring be used to manage and integrate hibernate?
First, let's take a look at the
-oriented programming capabilities into the spring framework. Therefore, it is easy to enable any object managed by the Spring framework to support AOP. The spring AOP module provides transaction management services for objects in spring-based applications. By using Spring A
-oriented programming capabilities into the spring framework. Therefore, it is easy to enable any object managed by the Spring framework to support AOP. The spring AOP module provides transaction management services for objects in spring-based applications. By using Spring A
by the Spring framework to support AOP. The spring AOP module provides transaction management services for objects in spring-based applications. By using Spring AOP, you can integrate declarative transaction management into your application without relying on EJB components.The Sp
Spring tutorial (I) Overview, spring tutorial Overview
Spring tutorial
Spring framework is an open-source Java platform that provides comprehensive infrastructure for easy and fast deve
configuration management feature, the Spring AOP module directly integrates Aspect-oriented programming functions into the spring framework. Therefore, any objects managed by the Spring framework can easily support AOP. The Spring AOP module provides transaction management services for objects in
Previous post: Spring Security 4 integrated Hibernate bcrypt password encryption (with source)
Original address: http://websystique.com/spring-security/spring-security-4-remember-me-example-with-hibernate/
"Related translated articles in this series, click on
Spring AOP module directly integrates Aspect-oriented programming functions into the spring framework. Therefore, any objects managed by the Spring framework can easily support AOP. The Spring AOP module provides transaction management services for objects in spring-based a
Spring 4 + jpa (hibernate 3/4) + spring mvc multi-data source configuration (2) + Druid connection pool, mvcdruid
Pick up a blog post (http://www.loveweir.com/html/18.html), no database connection pool, purely using the official link of jpa.
Therefore, we need to add the connection pool. In this article, we use the Druid connection pool to configure multiple data
Upload and download files in J2EE Programming is already a very old topic, and you may immediately be able to snap your fingers to figure out several famous big parts: smartupload, Apache . However, if your project is built in STRUTS + spring + Hibernate (Hereinafter referred to as "ssh") on the framework, these large parts are cumbersome and vicissitudes of life. SSH provides a simple and convenient soluti
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.