发表于: 2016-09-25 10:12:47

1 2244


一、今天完成
1.使用jetty启动,尝试调通task2失败,找资料、视频过流程,排查问题未果。
二、明天计划
1.调通,然后对task2的demo优化。
三、遇到问题
1.系统重启后idea无法正常打开文件目录,jar包依赖也全掉了,将项目.idea文件夹删掉,重新import即可打开文件目录;同时尝试到被JAR包虐待快感了,决定对pom.xml全部采取本地加载,网上重新下太没效率,明明本地都有。
<dependency>
 <groupId>log4j</groupId>
 <artifactId>log4j</artifactId>
 <version>1.2.17</version>
 <scope>system</scope>
 <systemPath>D:/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar</systemPath>
</dependency>
2.idea使用jetty不太会,参考丁师兄的demo,在pom.xml中配置<plugin>
四、收获
1.handler method 参数绑定常用的注解
A、处理requet uri 部分(uri template中variable,不含queryString部分)的注解:   @PathVariable;
B、处理request header部分的注解:   @RequestHeader, @CookieValue;
C、处理request body部分的注解:@RequestParam,  @RequestBody;
D、处理attribute类型是注解: @SessionAttributes, @ModelAttribute;
2.springMVC全部结构来源
3.mapper.xml的sql片段,可以不限定传参到底是哪些
<sql id="query_condition">
<if test="enroll != null">
<if test="enroll.student_name != null && enroll.student_name != ' '">
AND student_name like '%${enroll.student_name}%'
</if>
<if test="enroll.student_id != null ">
AND student_id = #{enroll.student_id }
</if>
</if>
</sql>
<select id="findByMultiplex" parameterType="Enroll" resultType="Enroll">
SELECT * FROM enroll
<where>
<include refid="query_condition" />
</where>
</select>
4.设计新增接口时,在service层接口就需要考虑dao层的数据库非空字段,这种字段单独提出来更有益于上层开发的人知道接口目的。



返回列表 返回列表
评论

    分享到