SSM框架搭建1

SSM框架搭建1,第1张

1.Maven依赖spring-webmvc

    
        org.springframework
        spring-webmvc
        5.2.6.RELEASE
    

    
        org.freemarker
        freemarker
        2.3.30
    

    
        org.springframework
        spring-context-support
        5.2.6.RELEASE
    

    
        com.fasterxml.jackson.core
        jackson-core
        2.11.0
    

    
        com.fasterxml.jackson.core
        jackson-annotations
        2.11.0
    

    
        com.fasterxml.jackson.core
        jackson-databind
        2.11.0
    

 

2.配置DispatcherServlet

    springmvc
    org.springframework.web.servlet.DispatcherServlet
    
        contextConfigLocation
        classpath:applicationContext*.xml
    
    0


    springmvc
    /

 3.开启SpringMVC注解模式




    
    

    

 4.解决中文乱码问题(POST请求)


    characterFilter
    org.springframework.web.filter.CharacterEncodingFilter
    
        encoding
        UTF-8
    


    characterFilter
    /*

 

解决响应式请求的中文乱码问题

    
        
            
                text/html;charset=utf-8
            
        
    

 

5.配置Freemarker模板引擎

    
    
        
            UTF-8
        
    


    
    

 6.JSON(Jackson)序列化输出
application/json;charset=utf-8

 

 

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/920164.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-16
下一篇 2022-05-16

发表评论

登录后才能评论

评论列表(0条)

保存