- 网页出现 406 错误
- 原因及解决方法
- 查看是否存在Jackson包
- 请求页面的后缀不能是 .html
- 解决post乱码问题
@RequestMapping(value = "/httpclient/post", method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE + ";charset=utf-8")
<insert id="insert" parameterType="com.taotao.pojo.TbContentCategory" >
<selectKey keyProperty="id" resultType="long" order="AFTER">
SELECT LAST_INSERT_ID()
</selectKey>>
insert into tb_content_category (id, parent_id, name,
status, sort_order, is_parent,
created, updated)
values (#{id,jdbcType=BIGINT}, #{parentId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{sortOrder,jdbcType=INTEGER}, #{isParent,jdbcType=BIT},
#{created,jdbcType=TIMESTAMP}, #{updated,jdbcType=TIMESTAMP})
</insert>
- update 返回值问题
- 使用原生的sql(或者mysql)重复请求update操作的时候,执行两次,update返回影响行数为 0
- 第三方持久化框架返回来的是被匹配的影响行数,所以返回的始终是1(mybatis)