进入toCustList方法..
进入cust无条件查询..
进入custList存值状态..
2011-1-16 16:24:58 org.apache.catalina.core.ApplicationDispatcher invoke
严重: Servlet.service() for servlet jsp threw exception
javax.el.PropertyNotFoundException: Property 'custNo' not found on type com.weiao.crm.entity.CstLost
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)
at javax.el.BeanELResolver.property(BeanELResolver.java:279)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:60)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
at org.apache.el.parser.AstValue.getValue(AstValue.java:123)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:935)
at org.apache.jsp.jsp.cust.cust.list_jsp._jspx_meth_c_005fforEach_005f0(list_jsp.java:229)
at org.apache.jsp.jsp.cust.cust.list_jsp._jspService(list_jsp.java:144)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        ...虽然主表查询与CstLost有关联,但是我在无条件查询主表时并没有关CstLost任何事,为什么访问该页面就报错?这错误是什么原因?何解?

解决方案 »

  1.   

    已经进入了存值状态,应该是只属于页面问题<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>客户信息管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="/crm/css/style.css" rel="stylesheet" type="text/css">
    </head>
    <script type="text/javascript">
        function to(path){
            window.location.href = path;
        }
        function del(path){
          window.location.href = path;
        }
        function reload(){
            document.forms[0].submit();
        }
    </script>
    <body>
    <c:if test="${sessionScope.custList==null}">
    <script>window.location.href = "cust!toCustList.action"</script>
    </c:if>
    <div class="page_title">客户信息管理</div>
    <div class="button_bar">
    <button class="common_button" onclick="help('');">帮助</button>
    <button class="common_button" onclick="reload();">查询</button>  
    </div>
    <form action="cust!toCustList.action" method="post">
    <table class="query_form_table">
    <tr>
    <th>客户编号</th>
    <td><input type="text" name="cust.custNo"/></td>
    <th>名称</th>
    <td><input type="text" name="cust.custName"/></td>
    <th>地区</th>
    <td>
    <select name="cust.custRegion">
    <option value="NULL">全部</option>
    <option value="北京">北京</option>
    <option value="华北">华北</option>
    <option value="中南">中南</option>
    <option value="东北">东北</option>
    <option value="西部">西部</option>
    </select>
    </td>
    </tr>
    <tr>
    <th>客户经理</th>
    <td><input type="text" name="cust.custManagerName"/></td>
    <th>客户等级</th>
    <td>
    <select name="cust.custLevelLabel">
    <option value="NULL">全部</option>
    <option value="战略合作伙伴">战略合作伙伴</option>
    <option value="合作伙伴">合作伙伴</option>
    <option value="大客户">大客户</option>
    <option value="普通客户">普通客户</option>
    </select>
    </td>
    <th> </th>
    <td> </td>
    </tr>
    </table>
    </form>
    <br />
    <table class="data_list_table">
    <tr>
    <th>序号</th>
    <th>客户编号</th>
    <th>名称</th>
    <th>地区</th>
    <th>客户经理</th>
    <th>客户等级</th>
    <th>操作</th>
    </tr>
    <c:forEach var="c" varStatus="i" items="${sessionScope.custList}">
    <tr>
    <td class="list_data_number">${i.index+1 }</td>
    <td class="list_data_text">${c.custNo }</td>
    <td class="list_data_ltext">${c.custName }</td>
    <td class="list_data_text">${c.custRegion }</td>
    <td class="list_data_text">${c.custManagerName }</td>
    <td class="list_data_text">${c.custLevelLabel }</td>
    <td class="list_data_op">
    <img onclick="to('/crm/jsp/cust/cust/edit.jsp?custNo=${c.custNo }');" title="编辑" src="/crm/images/bt_edit.gif" class="op_button" />
    <img onclick="to('/crm/jsp/cust/cust/linkman.jsp?custNo=${c.custNo }');" title="联系人" src="/crm/images/bt_linkman.gif" class="op_button" />
    <img onclick="to('/crm/jsp/cust/cust/activities.jsp?custNo=${c.custNo }');" title="交往记录" src="/crm/images/bt_acti.gif" class="op_button" />
    <img onclick="to('/crm/jsp/cust/cust/orders.jsp?custNo=${c.custNo }');" title="历史订单" src="/crm/images/bt_orders.gif" class="op_button" />

    <img onclick="del('cust!doCustDel.action?cust.custNo=${c.custNo }&cust.custName=${c.custName }');" title="删除" src="/crm/images/bt_del.gif" class="op_button" />

    </td>
    </tr>
    </c:forEach>
    <tr>
    <th colspan="100" class="pager">
    <div class="pager">
    共59条记录 每页<input value="10" size="2" />条
    第<input value="1" size="2"/>页/共5页
    <a href="#">第一页</a>
    <a href="#">上一页</a>
    <a href="#">下一页</a>
    <a href="#">最后一页</a>
    转到<input value="1" size="2" />页
    <button width="20" onclick="reload();">GO</button>
    </div>
    </th>
    </tr>
    </table>
    </body>
    </html>
      

  2.   

    Property 'custNo' not found on type com.weiao.crm.entity.CstLostCstLost这个类中有这个custNo属性吗?报这个错呀
      

  3.   

    看一下custNo 有没有getter和setter方法
      

  4.   

    O(∩_∩)O~,这个问题我昨天也遇到过的,最好找到原因了,是jsp页面的el表达式写错了,你的那个属性“custNo”可能忘记加“${   }”了。自己再仔细检查一下jsp页面吧。
      

  5.   

    +1 有这个属性并提供对应get、set方法。
      

  6.   

    CstLost里面没有custNo这个属性,custNo是一个外键,用来关联另一张表的。
      

  7.   

    如果楼主使用了Hibernate这样的后台技术,很可能会报连接已关闭的异常,那就需要使用OpenSessionInView了.另外建议写一个VO来保存需要显示的数据用,在POJO中,部门是有一个所属公司的.
    Dept
    {
       private Integer id;
       private Company company'
       private String deptName;
      
    }有时候需要显示部门名称,公司名称,VO则是
    DeptVo
    {
       private Integer id;
       private String detpName;
       private Integer companyId;
       private String companyName;
       //写上一个全属性的构造函数
    }在使用HQL查询的时候,就可以使用new技术了select new 类的路径.DeptVo(dept.id,dept.deptName,dept.company.id,dept.company.companyName)
     from Dept
    这样在页面上显示的时候就直接可以EL-->x.companyId,x.companyName来显示.f
      

  8.   

      是在页面中取出 'custNo' 出的错么,