qq_664231140 2016-12-12 02:45 采纳率: 0%
浏览 9435

source is null for getProperty(null, "fcityid")

进入页面 分页查询 直接报错

表单:

 <li><label>城市:</label>
                <form:select path="fcity.fcityid" class="input-medium" id="city" onchange="loadYsArea()">
                    <form:option value="">请选择</form:option>
                    <c:forEach items="${cities }" var="cityList">
                        <form:option value="${cityList.fcityid }">${cityList.fname }</form:option>
                    </c:forEach>

                </form:select>
            </li>

实体

 private YsCity fcity;      // 城市
    private YsArea farea;       // 区域
    private YsGarden fgarden;       // 社区
    get/set...

sql:

 <where>

            <if test="fhouseid != null and fhouseid != ''">
                AND a.fhouseid = #{fhouseid}
            </if>

            <if test="fcity.fcityid != null and fcity.fcityid != ''">
                AND a.fcity = #{fcity.fcityid}
            </if>
            <if test="farea.fareaid != null and farea.fareaid != ''">
                AND a.farea = #{farea.fareaid}
            </if>
            <if test="fgarden.fgardenid != null and fgarden.fgardenid != ''">
                AND a.fgarden = #{fgarden.fgardenid}
            </if>

错误信息

 2016-12-12 10:23:37,210 ERROR [500.jsp] - nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'fcity.fcityid != null and fcity.fcityid != '''. Cause: org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "fcityid")
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'fcity.fcityid != null and fcity.fcityid != '''. Cause: org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "fcityid")

不知道我贴的信息全不全 希望大神帮忙看看

  • 写回答

2条回答 默认 最新

  • bdmh 移动开发领域优质创作者 2016-12-12 03:08
    关注

    最后的信息提示了,数据源为空,导致访问了空对象

    评论

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler