SSH framework and build understanding

SSH to build a framework of understanding

First contact SSH framework is in junior next semester WEB program curriculum design, when the team was assigned to develop research management system of colleges, technical head of the house led us to set up a group of small rookie SSH framework, I felt a very big, very subtle, then as deputy head for SSH framework only superficial understanding of this semester exam to determine their own to try to build a SSH small project to deepen the understanding of the framework.

First, let's introduce the following SSH what are:

Struts2: The framework for processing business logic, i.e. the control jsp jump.

Spring: It is used to manage Struts2 and Hibernate , providing injection and annotation. For example, if a previous Service call DAO to their own new one, but with Spring after the frame that allows the caller and the callee separately, that is to say Spring to provide this new process, reducing the coupling of both.

Hibernate : This is used for data persistence framework, the so-called data persistence that is, data stored in the database of the process. Using this framework so that we can avoid a lot of SQL written statement.

 

A good clear structure Web project should be divided into the following layers:

        


Strut.xml file is usually

 

As shown above, the configuration action name and its corresponding class, which returns the result how to jump.

Hibernate configuration file:

 

Mainly the mapping table.

Spring configuration file to write is more and more:

 


 

As can be seen, the configuration of the service, the Hibernate data source, SessionFactory , DAO and the like. If you do not want to configure so many ways injection can also be used, it does not say in detail here. After configured, you do not need to use these new , such as:

 

This service is used DAO is not new, but by Spring completed the injection framework of ~ ~ .

As for the building process, look at this:

Java 's based on Eclipse to build SSH framework ( on ) - SnowWitch 's blog - blog Channel - CSDN.NET http://blog.csdn.net/snowwitch/article/details/50925382

 

Published 47 original articles · won praise 8 · views 30000 +

Guess you like

Origin blog.csdn.net/nanchengyu/article/details/54290974