(实战篇)SSM三大框架整合详细教程(Spring+SpringMVC+MyBatis)

< pre class = "html" name = "code" snippet_file_name = "blog_20170402_1_8023453" code_snippet_id = "2295822" >< span style = "font-size:14px;" >< project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
   < modelVersion >4.0.0</ modelVersion >
   < groupId >PetTest</ groupId >
   < artifactId >pet-commonTest</ artifactId >
   < packaging >war</ packaging >
   < version >0.0.1-SNAPSHOT</ version >
   < name >pet-commonTest Maven Webapp</ name >
   < url >http://maven.apache.org</ url >
   < properties >
       < project.build.sourceEncoding >UTF-8</ project.build.sourceEncoding >
       < spring.version >4.2.0.RELEASE</ spring.version >
       < jackson-core.version >2.6.1</ jackson-core.version >
       <!-- log4j日志文件管理包版本 -->
         < slf4j.version >1.7.7</ slf4j.version >
         < log4j.version >1.2.17</ log4j.version >
   </ properties >
 
   < dependencies >
     < dependency >
       < groupId >junit</ groupId >
       < artifactId >junit</ artifactId >
       < version >4.12</ version >
       < scope >test</ scope >
     </ dependency >
 
     <!-- servlet -->
     < dependency >
         < groupId >javax.servlet</ groupId >
         < artifactId >javax.servlet-api</ artifactId >
         < version >3.1.0</ version >
     </ dependency >
 
     <!-- spring -->
     < dependency >
         < groupId >org.springframework</ groupId >
         < artifactId >spring-core</ artifactId >
         < version >${spring.version}</ version >
     </ dependency >
     < dependency >
         < groupId >org.springframework</ groupId >
         < artifactId >spring-webmvc</ artifactId >
         < version >${spring.version}</ version >
     </ dependency >
     < dependency >
         < groupId >org.springframework</ groupId >
         < artifactId >spring-context</ artifactId >
         < version >${spring.version}</ version >
     </ dependency >
     < dependency >
         < groupId >org.springframework</ groupId >
         < artifactId >spring-tx</ artifactId >
         < version >${spring.version}</ version >
     </ dependency >
     < dependency >
         < groupId >org.springframework</ groupId >
         < artifactId >spring-jdbc</ artifactId >
         < version >${spring.version}</ version >
     </ dependency >
    
     <!-- mysql -->
     < dependency >
         < groupId >mysql</ groupId >
         < artifactId >mysql-connector-java</ artifactId >
         < version >5.1.36</ version >
     </ dependency >
 
     <!-- JSTL标签类 -->
         < dependency >
             < groupId >jstl</ groupId >
             < artifactId >jstl</ artifactId >
             < version >1.2</ version >
         </ dependency >
         <!-- 日志文件管理包 -->
         <!-- log start -->
         < dependency >
             < groupId >log4j</ groupId >
             < artifactId >log4j</ artifactId >
             < version >${log4j.version}</ version >
         </ dependency >
         <!-- 格式化对象,方便输出日志 -->
         < dependency >
             < groupId >org.slf4j</ groupId >
             < artifactId >slf4j-api</ artifactId >
             < version >${slf4j.version}</ version >
         </ dependency >
         < dependency >
             < groupId >org.slf4j</ groupId >
             < artifactId >slf4j-log4j12</ artifactId >
             < version >${slf4j.version}</ version >
         </ dependency >
 
     <!-- mybatis -->
     < dependency >
         < groupId >org.mybatis</ groupId >
         < artifactId >mybatis</ artifactId >
         < version >3.3.0</ version >
     </ dependency >
     < dependency >
         < groupId >org.mybatis</ groupId >
         < artifactId >mybatis-spring</ artifactId >
         < version >1.2.3</ version >
     </ dependency >
     
       < dependency >
         < groupId >commons-dbcp</ groupId >
         < artifactId >commons-dbcp</ artifactId >
         < version >1.4</ version >
     </ dependency >
   </ dependencies >
   < build >
     < finalName >pethome</ finalName >
     < resources
       <!-- maven项目中src源代码下的xml等资源文件编译进classes文件夹,
         注意:如果没有这个,它会自动搜索resources下是否有mapper.xml文件,
         如果没有就会报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.pet.mapper.PetMapper.selectByPrimaryKey-->
       < resource
         < directory >src/main/java</ directory
         < includes
           < include >**/*.xml</ include
         </ includes
       </ resource >
       
       <!--将resources目录下的配置文件编译进classes文件  --> 
        < resource >
         < directory >src/main/resources</ directory >
        </ resource >
     </ resources
   </ build >
</ project ></ span >
</ pre >
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值