Jquery级联问题,数据后端已取到,在页面上展示不出来

Simple_Key 2010-01-06 02:31:04
如题
代码如下
<select name="chaPart" id="chaPart" style="width: 240px"
value="listChannal">
<c:if test="${listChannal != null}">
<c:forEach items="listChannal" var="c">
<option value="${c.channalID}">
${listChannal.title}
</option>
</c:forEach>
</c:if>
</select>
现在后端已经取到了
运行结果

进入Action
Hibernate: select tbwccity0_.cityCode as cityCode13_, tbwccity0_.province as province13_, tbwccity0_.name as name13_, tbwccity0_.isEnable as isEnable13_, tbwccity0_.memo as memo13_, tbwccity0_.createdDate as createdD6_13_, tbwccity0_.lastModifiedDate as lastModi7_13_ from Tb_WC_Mob_City tbwccity0_
开始查询频道
0755
Hibernate: select distinct tbwcchanna1_.ID as ID17_, tbwcchanna1_.channalID as channalID17_, tbwcchanna1_.title as title17_, tbwcchanna1_.pictureID as pictureID17_, tbwcchanna1_.pressPictureID as pressPic5_17_, tbwcchanna1_.focusPictureID as focusPic6_17_, tbwcchanna1_.property as property17_, tbwcchanna1_.displayOrder as displayO8_17_, tbwcchanna1_.memo as memo17_, tbwcchanna1_.createdDate as created10_17_, tbwcchanna1_.lastModifiedDate as lastMod11_17_ from Tb_WC_Mob_ChaSec tbwcchasec0_, Tb_WC_Mob_Channal tbwcchanna1_ where tbwcchasec0_.channalID=tbwcchanna1_.channalID and tbwcchasec0_.cityCode=? order by tbwcchanna1_.displayOrder
[com.covics.model.TbWcChannal@1e35ecd, com.covics.model.TbWcChannal@64e5b2, com.covics.model.TbWcChannal@2445d7]
2010-1-6 14:21:57 org.apache.catalina.core.ApplicationDispatcher invoke
严重: Servlet.service() for servlet jsp threw exception
javax.el.PropertyNotFoundException: Property 'channalID' not found on type java.lang.String
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:53)
at org.apache.el.parser.AstValue.getValue(AstValue.java:114)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:923)
at org.apache.jsp.maincate_jsp._jspx_meth_c_005fforEach_005f2(maincate_jsp.java:358)
at org.apache.jsp.maincate_jsp._jspx_meth_c_005fif_005f0(maincate_jsp.java:322)
at org.apache.jsp.maincate_jsp._jspService(maincate_jsp.java:175)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:362)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
at com.opensymphony.xwork2.DefaultActio

[com.covics.model.TbWcChannal@1e35ecd, com.covics.model.TbWcChannal@64e5b2, com.covics.model.TbWcChannal@2445d7] 是listChannal的值
报个字段的错误 字段我在后端取没问题 在前端取就出这个 我看数据库的字段不下10遍了 请各位大哥给点意见 真的找不出是什么原因
...全文
284 9 打赏 收藏 举报
写回复
9 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
Simple_Key 2010-01-06
  • 打赏
  • 举报
回复
谢谢各位了 特别是一楼和8楼
Love_baba_mama 2010-01-06
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 lihui_shine 的回复:]
<c:forEach items="${listChannal}" var="c">
<option value="${c.channalID}">
${c.title}
</option>
</c:forEach>
[/Quote]
没看出什么错来,换成上面的试试啊
lijichang1234 2010-01-06
  • 打赏
  • 举报
回复
Simple_Key 2010-01-06
  • 打赏
  • 举报
回复
开始查询频道
020
Hibernate: select distinct tbwcchanna1_.ID as ID17_, tbwcchanna1_.channalID as channalID17_, tbwcchanna1_.title as title17_, tbwcchanna1_.pictureID as pictureID17_, tbwcchanna1_.pressPictureID as pressPic5_17_, tbwcchanna1_.focusPictureID as focusPic6_17_, tbwcchanna1_.property as property17_, tbwcchanna1_.displayOrder as displayO8_17_, tbwcchanna1_.memo as memo17_, tbwcchanna1_.createdDate as created10_17_, tbwcchanna1_.lastModifiedDate as lastMod11_17_ from Tb_WC_Mob_ChaSec tbwcchasec0_, Tb_WC_Mob_Channal tbwcchanna1_ where tbwcchasec0_.channalID=tbwcchanna1_.channalID and tbwcchasec0_.cityCode=? order by tbwcchanna1_.displayOrder
市政服务----114
便民服务----115
消费服务----117
出行交通----116
政务信息----119
更多----118
餐饮----120
娱乐----121

这是后台呈现出来的数据 在页面上面现在是


<select name="chaPart" id="chaPart" style="width: 240px"
value="listChannal">
<c:forEach items="${listChannal}" var="listChannal">
<option id="${listChannal.channalID}">
${listChannal.title}
</option>
</c:forEach>
</select>
取不出 不报错
Simple_Key 2010-01-06
  • 打赏
  • 举报
回复
页面上面展示的结果 只展示第一个 不展示第二个数据了 俩个下拉列表框 数据全部在后台采集到了
Simple_Key 2010-01-06
  • 打赏
  • 举报
回复
。。。 谢谢 问题是这样的 但是根本原因还是页面上面展示不出来。? 错也不报了 是不是jquery不能访问本身页面?
timeriver_wang 2010-01-06
  • 打赏
  • 举报
回复
可能是这2个地方命名不一致,你误用了数据库里的字段了
猜想channal.xml里的
<property name="channalID" type="java.lang.String">
<column name="channalID" length="1" />
</property>

这里已经映射好了,所以你就不能(也不需要)用数据库里的字段了
而应该用Chanal类的属性
timeriver_wang 2010-01-06
  • 打赏
  • 举报
回复
个人认为:
这里的${c.channalID}应该是POJO里Channal类里的属性
不是指数据库里面得字段

浪尖赏花 2010-01-06
  • 打赏
  • 举报
回复
<c:forEach items="${listChannal}" var="c">
<option value="${c.channalID}">
${c.title}
</option>
</c:forEach>
相关推荐
发帖
JavaScript

8.7w+

社区成员

Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
帖子事件
创建了帖子
2010-01-06 02:31
社区公告
暂无公告