SSM framework building and learning (3) --- integrate the Spring framework into the final SSM framework, ssm --- spring

Source: Internet
Author: User

SSM framework building and learning (3) --- integrate the Spring framework into the final SSM framework, ssm --- spring

With the integration of SpringMVC and Mabatis, a preliminary WEB framework is formed, but the complete SSM framework still needs Spring support!

So far, the configuration file we have added includes the core configuration file web. xml, springmvc configuration file spring-servlet.xml and Mabatis configuration file mybatis-config.xml, then there is the last Spring configuration file applicationContext. xml.

1) Add the following Spring configuration information to web. xml

Step 1: Load listener

<Listener>
<Listener-class> org. springframework. web. context. ContextLoaderListener </listener-class>
</Listener>

Step 2: specify the location and name of the spring configuration file.

<Context-param>
<Param-name> contextConfigLocation </param-name>
<Param-value>/WEB-INF/applicationContext. xml </param-value>
</Context-param>

1) Add the following configuration information to the Spring configuration file applicationContext. xml:

  

  

    

 

OK, with the Spring configuration file, a complete SSM framework has been formed, but here we should note that this is only the most basic SSM framework and the most basic WEB framework, we do not respect any other auxiliary enhanced frameworks. We only have this basic framework in our daily work. It is far from enough in terms of efficiency or development suggestions, we can use this as the basis to expand the desired structure (such as creating a Maven project rather than the original web project amount !).

 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.