个人学习笔记----基于Spring4.3.1+mybatis+postgresql+maven搭建的个人用调度平台(一)

一、前言
本博客主要记录博主自行搭建的一个简易的调度平台,用于日后学习及日后想要利用该平台来完成部分简单重复的工作和数据采集。工具是IntelliJ IDEA 2016.1.3

二、框架

使用Spring4.3.1,mybatis,postgresql,maven,junit,log4j,JQ3.1.1,java版本1.8。以下是pom配置

  4.0.0
  lu.basis_schedule_sys
  basis_schedule_sys
  war
  1.0-SNAPSHOT
  basis_schedule_sys
  http://maven.apache.org
  
    4.3.1.RELEASE
    1.3.2
    3.8.1
    2.6.2
    6.0.3
    9.4.1209
    3.4.1
    1.3.0
    2.1.1
    20160810
  

  

    
    
      junit
      junit
      ${junit.version}
    
    

    

    
      org.apache.logging.log4j
      log4j-api
      ${log4j.version}
    

    
      org.apache.logging.log4j
      log4j-core
      ${log4j.version}
    

    
      org.apache.logging.log4j
      	log4j-jcl
      ${log4j.version}
    

    
      org.apache.logging.log4j
      	log4j-slf4j-impl
      ${log4j.version}
    

    
      org.apache.logging.log4j
      	log4j-taglib
      ${log4j.version}
    

    

    


    
    
      org.springframework
      spring-context
      ${spring.version}
    


    

    
      org.springframework
      spring-webmvc
      ${spring.version}
    

    
    
      org.springframework
      spring-jdbc
      ${spring.version}
    

    
    
      org.springframework
      spring-tx
      ${spring.version}
    





    
    
    
      org.postgresql
      postgresql
      ${postgresql}
    

    
    
      org.mybatis
      mybatis
      ${mybatis.version}
    

    
    
      org.mybatis
      mybatis-spring
      ${mybatis-spring.version}
    

    
    
      org.apache.commons
      commons-dbcp2
      ${commons-dbcp2.version}
    

    
    
      org.json
      json
      ${json.version}
    





  


  
    maven_spring_mybatis
  

所有版本号写在上方定义,方便管理。
web.xml配置:




  maven_spring_test

  
  
    webAppRootKey
    webApp.root
  

  
  
    contextConfigLocation
    classpath:config/applicationContext.xml
  



  
  
    encodingFilter
    org.springframework.web.filter.CharacterEncodingFilter
    
      encoding
      UTF-8
    
    
      forceEncoding
      true
    
  
  
    encodingFilter
    /*
  

  
  
    org.springframework.web.context.ContextLoaderListener
  

  
    springDispatcher
    org.springframework.web.servlet.DispatcherServlet
    
      contextConfigLocation
      classpath:config/servletContext.xml
    
    1
  
  
    springDispatcher
    *.do
  

  
    html/index.html
  




接下来配置spring,加入注解
servletContext.xml



    
    

    
    

applicationContext.xml



    
    
    
    
    
    

spring-mybaits.xml




    
    

    
    
         
        
        
        
        
        
        
        
        
        
        clientEncoding=UTF-8
        

    

    
    
    

    
    
        
        
    

    
        
    
    
    
jdbc.properties

#Postgresql
jdbc.driverClassName=org.postgresql.Driver
jdbc.url=jdbc:postgresql://localhost:5432/schedule_sys
jdbc.username=lu
jdbc.password=123456
dialect=postgresql

spring-service.xml


    
    


    
    
        
        
        
        
        
        
        
        
    


spring-dao.xml


    
    
log4j.xml



    


        
            
        
        
        
        
        
            
        

        
        
            
            
        
    

    

        
        
              
             
             
        

        
            
            
        

        
            
        
    
 
恩,做完这些配置之后框架就搭起来了

注意点:

1、log4j.xml是自动扫描的,所以不要改名字,位置要放在resources底下,IntelliJ IDEA要设置resource类型

















你可能感兴趣的:(项目笔记)