springmvc-config.xml template

<?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:mvc="http://www.springframework.org/schema/mvc"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/mvc
                        http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
                        http://www.springframework.org/schema/beans
                        http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
                        http://www.springframework.org/schema/context 
                          http://www.springframework.org/schema/context/spring-context-4.0.xsd " > 
    
    <-! 1. distal end configured to release static resource controller ( html / css / js, otherwise static resources can not be accessed) -> 
    < MVC: default-the servlet-Handler /> 
    
    <-! 2. annotation-driven configuration to identify annotations (such as @Controller) -> 
    < MVC: Annotation-Driven > </ MVC: Annotation-Driven > 
    
    <-! 3. configured to scan packages: spring automatically to scan type in base-package, 
        if the scanned @ Controller class, @ Service, @Component other annotations, 
        will automatically register the class of the bean 
     -> 
    < context: Scan-Component Base-Package = "com.tsvv.controller"> 
    </ Context: Component-Scan > 
    
    <-! 4. Configuration of internal resources view resolver 
        prefix: Prefix configuration path 
        suffix: Profile suffix 
     -> 
    < the bean class = "org.springframework.web.servlet.view.InternalResourceViewResolver " > 
        < Property name =" prefix " value =" / the WEB-INF / Pages / " /> 
        < Property name =" suffix " value =." JSP " /> 
    </ the bean > 
    
    
</ Beans >

 

Guess you like

Origin www.cnblogs.com/tsvv-plus/p/11911069.html