zoukankan      html  css  js  c++  java
  • Cause: org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "goods_name")

      记录一下这个错误。

    报错原因:

    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'pd.goods_name!= null and pd.goods_name!= '''. Cause: org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "goods_name")

    分析:

    由于项目框架里有个将map封装成PageData,我通过new PageData ,将前端jsp传到controller的参数进行保存。不过没有再做pd.put("goods_name",pd.getString("goods_name"));处理,而此时maping.xml里就不能在用pd获取了。(它会直接用它封装的方法,return 一个map)

    错误写法:

    <if test="pd.goods_name!= null and pd.goods_name!= ''">
                and
                goods_name like concat('%', #{pd.goods_name},'%')
    </if>

    把pd.去掉即可。

    <if test="goods_name!= null and goods_name!= ''">
                and
                goods_name like concat('%', #{goods_name},'%')
    </if>
  • 相关阅读:
    创建线程方法&守护线程
    可见性
    线程池
    Callable创建线程
    使用java读取excel数据
    shell 中的操作符
    shell 中的特殊变量
    shell 变量定义使用
    golang 解码未知键的 json 字符串
    golang json 编码解码
  • 原文地址:https://www.cnblogs.com/yuanmaolin/p/11150230.html
Copyright © 2011-2022 走看看