Introduction to the framework:
Spring is an open source framework, and spring is a lightweight Java development framework that emerged in 2003 by Rod Johnson in his book expert one-on-one development and Some of the concepts and prototypes elaborated in design are derived. It is created to address the complexities of enterprise application development. One of the main advantages of the framework is its layered architecture, which allows the user to choose which component to use, while providing an integrated framework for Java EE application development. Spring uses basic JavaBean to accomplish things that were previously only possible by EJBS. However, the use of spring is not limited to server-side development. From the standpoint of simplicity, testability, and loose coupling, any Java application can benefit from spring. The core of spring is control inversion (IoC) and facet-oriented (AOP). In short, spring is a layered javase/eefull-stack ( one-stop) lightweight open-source framework.
Required Lib Package:
Download all packages for spring3.2 and include Struts2-spring-plugin-2.3.24.jar.
There are also 3 optional configuration packages that need to be introduced when Aspectjweaver.jar,cglib-nodep-2.1_3.jar is useful to an AOP slice . Com.springsource.org.aopalliance-1.0.0.jar
Configuration process:
1. Start by creating a spring configuration file below src.
<?xml version= "1.0" encoding= "UTF-8"? ><beans xmlns= "Http://www.springframework.org/schema/beans" xmlns: Xsi= "Http://www.w3.org/2001/XMLSchema-instance" xmlns:aop= "HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP" xmlns:tx= " Http://www.springframework.org/schema/tx "xsi:schemalocation=" Http://www.springframework.org/schema/beans http:/ /www.springframework.org/schema/beans/spring-beans-2.0.xsd HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/TX/HTTP Www.springframework.org/schema/tx/spring-tx-2.0.xsd HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP/HTTP Www.springframework.org/schema/aop/spring-aop-2.0.xsd "> <bean id=" manageservlet "class=" Com.babybus.sdteam.bo.ManageServlet "> </bean> <bean id=" Aopclass "class=" Com.babybus.sdteam.bo.AopClass "> </bean> <!--loginaction-<bean id=" loginaction "class=" com.b Abybus.sdteam.action.LoginAction "> <property name=" manageservlet "ref=" Manageservlet "></property> & Lt;/bean> <!--cutFace configuration-<aop:config proxy-target-class= "true" > <!--facets corresponding to class--<aop:aspect id= "MYAOP" ref= "Aopc Lass > <!--pointcut configuration-<aop:pointcut id= "AP" expression= "Execution (* com.babybus.sdteam.bo.*.* (..)) "/> <aop:before method=" Methodbefore "pointcut-ref=" AP "/> <aop:after method=" MethodAfter "pointcut -ref= "AP"/> </aop:aspect> </aop:config> </beans>
2. Follow the spring monitoring configuration on Web. xml
<!--spring configuration file Location--<context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/classes/applicationContext.xml</param-value> </context-param><! --listener-- <listener> <listener-class> Org.springframework.web.context.contextloaderlistener</listener-class> </listener>
3. Precautions
When the error, please confirm <aop:config proxy-target-class= "true" > and this article at the beginning of the 3 optional package of imports, after the import of the project clean again and then execute, and then the project can start successfully.
On this side, we've already talked about all the back-end technologies of Javaweb, and we have the flexibility to respond to back-end work.
Conclusion
- Benefits, mastering Spring's primary application
This site article is for baby bus SD. Team Original, reproduced must be clearly noted: (the author's official website: Baby bus )
Reprinted from "Baby bus Superdo Team" original link: http://www.cnblogs.com/superdo/p/4641670.html
[Javaweb Basic] 008.Spring preliminary configuration