在maven的ssm环境中配置druid查看SQL性能

如果有人在C站中看到此文章那应该就是我,不要举报我C用户id是:as953


      junit
      junit
      4.11
      test
    

    
      org.springframework
      spring-core
      4.3.18.RELEASE
    
    
      org.springframework
      spring-aop
      4.3.18.RELEASE
    
    
      org.springframework
      spring-tx
      4.3.18.RELEASE
    
    
      org.springframework
      spring-beans
      4.3.18.RELEASE
    
    
      org.springframework
      spring-context
      4.3.18.RELEASE
    
    
      org.springframework
      spring-webmvc
      4.3.18.RELEASE
    
    
      org.springframework
      spring-web
      4.3.18.RELEASE
    
    
      org.springframework
      spring-expression
      4.3.18.RELEASE
    
    
      org.springframework
      spring-context-support
      4.3.18.RELEASE
    
    
      org.springframework
      spring-oxm
      4.3.18.RELEASE
    
    
      org.projectlombok
      lombok
      1.18.2
    
    
      javax.servlet
      javax.servlet-api
      3.1.0
    


    
    
      org.mybatis
      mybatis
      3.4.0
    
    
      org.mybatis
      mybatis-spring
      1.3.2
    

    
      mysql
      mysql-connector-java
      5.1.44
    
    
      com.alibaba
      fastjson
      1.2.41
    
    
    
    
      org.springframework
      spring-jdbc
      4.3.18.RELEASE
    
    
      com.alibaba
      druid
      1.1.23
    

web.xml文件:

注意: web.xml文件中是有先后顺序的 ,我deomo中用到的示例的先后顺序是:\,\,\,\,\,\,\,\,\


Archetype Created Web Application
  
    contextConfigLocation
    classpath:applicationContext.xml
  

  
    DruidWebStatFilter
    com.alibaba.druid.support.http.WebStatFilter
    
      exclusions
      *.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*
    

  

  
    characterEncodingFilter
    org.springframework.web.filter.CharacterEncodingFilter
    
      encoding
      utf-8
    
    
      forceEncoding
      true
    
  

  
    characterEncodingFilter
    /*
  

  
    DruidWebStatFilter
    /*
  



  
    org.springframework.web.context.ContextLoaderListener
  



  
    mvc
    org.springframework.web.servlet.DispatcherServlet
    
      contextConfigLocation
      classpath:mvc-servlet.xml
    
  


  
    DruidStatView
    com.alibaba.druid.support.http.StatViewServlet
    
      
      loginUsername
      root
    
    
    
    loginPassword
    root
    
  


  
    DruidStatView
    /druid/*
  

  
    mvc
    *.do
  
  

db.properties文件:

mysql.driver=com.mysql.jdbc.Driver
mysql.url= jdbc:mysql://localhost:3306/db_demo
mysql.user=root
mysql.password=root

applicationContext.xml:


    
    
        
        
        
        
    

    
        
    
    
        
    
    

其他文件省略……至于怎么写就是你们自己的事儿了
运行成功后如果没有文件名的话访问:
http://localhost:8080/druid/i...

有文件名的访问:
http://localhost:8080/文件名/druid/index.html

你可能感兴趣的:(在maven的ssm环境中配置druid查看SQL性能)