发表于: 2016-11-10 11:47:45

11 2743


声明:  本人很用心的写日志。基本上是做完一个小小的任务或者解决一个小Bug都会记录一下! 为了就是给后来者一个很有价值的参考。本人不会把GitHub上的源代码链接发到这里.原因你懂得。照抄别人的代码是当不了真正的程序员的,也完全符合修真院的宗旨。有不懂的或者不会的,可以一起讨论。谢谢)

叩首问路,码梦为生..... 各位兄弟,加油!)

一.今天完成的事情

      1.创建maven web项目 http://www.cnblogs.com/leskang/p/5434570.html

           (吐槽一下,下载一个Tomcat7  9M多点花了半个小时,奶奶的这网速,哎  想死)

      2.使用jetty:run命令启动jetty服务(只实现了http方式,没有实现https的方式)

      3.对任务一进行基于注解的开发(目的:使用Spring 配置IOC

  1. <mappers>  
  2.    <!-- 通过package元素将会把指定包下面的所有Mapper接口进行注册 -->  
  3.    <package name="com.tiantian.mybatis.mapperinterface"/>  
  4.    <!-- 通过mapper元素的resource属性可以指定一个相对于类路径的Mapper.xml文件 -->  
  5.    <mapper resource="com/tiantian/mybatis/mapper/UserMapper.xml"/>  
  6.    <!-- 通过mapper元素的url属性可以指定一个通过URL请求道的Mapper.xml文件 -->  
  7.    <mapper url="file:///E:/UserMapper.xml"/>  
  8.    <!-- 通过mapper元素的class属性可以指定一个Mapper接口进行注册 -->  
  9.    <mapper class="com.tiantian.mybatis.mapperinterface.UserMapper"/>  
  10. </mappers>  

       当使用mapper元素进行Mapper定义的时候需要注意:mapper的三个属性resource、url和class对于每个mapper元素只能指定一个,要么指定resource属性,要么指定url属性,要么指定class属性,不能都指定,也不能都不指定。

二.明天的计划

    1.完成Spring配置IOC(与MyBatis的整合)

     2.学习Rest接口风格

     3.使用SpringMVC完成REST接口。

三.遇到的问题

      1.tomcat启动   输入http://localhost:8080报错:404  输入http://localhost:8080/task2 正常访问

         原因:Eclipse中Tomcat的配置问题

         解决:https://zhidao.baidu.com/question/1640428204620564020.html 

                 http://yedward.net/?id=303

       2.pom.xml配置好Jetty插件  启动正常但访问报错:PWC6345: There is an error in invoking javac. 

          A full JDK (not just JRE) is   尝试了N种方法都没有解决,最后卸掉JDK,重新装 (bug解决).

      3.在对任务一进行注解开发时,发现前面设计数据库时  属性名与字段名不一一对应.(这是个巨坑)

         导致的结果:

      @Select("select student_id as studentId,student_name as studentName,"

+ "student_age as studentAge,student_profession as         studentProfession,"

+ "create_at as createAt, update_at as updateAt from student "

+ "where student_id=#{id}")

public Student selectStudentById(int id);


四.收获

      1.学习了Jetty以及在Eclipse中用配置插件。(http方式可以访问)

      2.学习了MyBatis数据库字段与属性不一致的两种处理方式

      3.明确service和impl的差别。链接:https://zhidao.baidu.com/question/403533244.html

五.总结

     1.今天做任务搞了六个小时吧,总感觉时间不够用,中午没有午休。

     2.与日志中的计划整整慢一天的时间,原因:做着任务总是碰到各种小问题,浪费了宝贵的时间

     3.明天继续加油吧。(明天要去参加一场招聘,估计又得浪费半天的时间,希望好运。一起加油)

     


返回列表 返回列表
评论

    分享到