JSP页面便利集合的时候,代码如下

<s:iterator value="storageList" id="stList" status="st">
<tr>
<td class="list_data_number"><s:property value="#st.index+1"/></td>
<td class="list_data_ltext"><s:property value="#stList.product.prodName"/> </td>
<td class="list_data_ltext"><s:property value="#stList.stkWarehouse"/> </td>
<td class="list_data_text"><s:property value="#stList.stkWare"/></td>
<td class="list_data_number"><s:property value="#stList.stkCount"/></td>
<td class="list_data_ltext"><s:property value="#stList.stkMemo"/></td>
</tr>
</s:iterator>

  

结果是:<s:property value="#stList.product.prodName"/>出现ognl.NoConversionPossible错误

原因是:Struts没办法把页面的值转换成你Action里面定义的值。

修改实体映射文件,添加懒加载(lazy="false"):

        <many-to-one name="product" class="com.wdy.orm.Product" fetch="select" lazy="false">
<column name="stk_prod_id" not-null="true">
<comment>产品编号,外键</comment>
</column>
</many-to-one>

  

struts的ognl.NoConversionPossible错误的更多相关文章

  1. Struts 2 OGNL

    1.什么是OGNL? 2.Struts 2 OGNL 表达式      ======================  华丽丽的分割线  ======================  1.什么是OG ...

  2. struts基于ognl的自动类型转换需要注意的地方

    好吧,坎坷的过程我就不说了,直接上结论: 在struts2中使用基于ognl的自动类型转换时,Action中的对象属性必须同时添加get/set方法. 例如: 客户端表单: <s:form ac ...

  3. ognl版本错误

    错误信息: 2014-2-6 21:20:10 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() fo ...

  4. struts与ognl结合【重要】

    -----------------------------ognl表达式------------------------ OGNL:对象视图导航语言.  ${user.addr.name} 这种写法就 ...

  5. java框架篇---struts之OGNL详解

    OGNL(Object Graph Navigation Language),是一种表达式语言.使用这种表达式语言,你可以通过某种表达式语法,存取Java对象树中的任意属性.调用Java对象树的方法. ...

  6. 关于struts中Ognl和iterator配合再次理解

    Person.jsp (struts.xml中省略) package com.mzy.entity; public class Person { private String name; privat ...

  7. struts(三) ---OGNL的学习和理解

    OGNL:Object graphic Navgation Language(对象图形的导航语言)

  8. myeclipse 右键 Add Struts... 页面报404 错误

    网上试了很多种方法都不对,结果老师两下点出来了 我的改正方法是: 将WebRoot/WEB-INF/web.xml中的 <url-pattern>/*</url-pattern> ...

  9. 在Eclipse IDE进行Struts开发时提示错误:java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher的解决办法

    If you have... included all necessary jars Configured build path correctly added them all in deploym ...

随机推荐

  1. facebook分享遇到的错误解决方法

    *** Terminating app due to uncaught exception 'InvalidOperationException', reason: ''App ID not foun ...

  2. angularJS怎么实现与服务端的PHP进行数据交互

    //{params: 要传的参数obj },params这个是关键字不能换别的变量 $http.get(url, {params: {id: categoryid, key: keys} }).suc ...

  3. Qt 格式化字符串

    Qt字符串格式化性能比较 Qt字符串格式方法有三种, QString::arg(), QString::sprinft()和QStringList::join().今天我做了个简单的性能测试, 希望对 ...

  4. ini文件解析c库(iniparser)

    一.交叉编译ini解析库 1.官方网站http://ndevilla.free.fr/iniparser 下载iniparser-3.1.tar.gz 2.解压 tar -zxvf iniparser ...

  5. Linux下一些基本操作

    一.忘记root密码 1. sudo passwd root 2. 输入新密码. 二.查看内核版本: 1.查看内核版本命令:1) cat /proc/version 2) uname -a 3)  u ...

  6. Mindset + Know-how+Concepture + Methodology+Technology

    在做成都专案过程中深刻体会到一个IT全才应该具备Domain Know-how,拥有正确地理念是十分重要的, 我想只能是某几个领域,专案管理,专案运行中的各种手法,即Methodology,最后才是K ...

  7. 今天工作中遇到的根据用户id取得产品大类和相关小类的问题

    今天做了一个项目,需求是客户登陆后,可以从会员中心发布详细信息(包括联系信息和公司信息),插入到数据库后在将来生成一个公司页面模板,一般的产品大类+小类 用repeater嵌套就可以了,但是这个涉及到 ...

  8. JS 无提示关闭当前窗口

    function teseClose() { window.opener = null; window.open('','_self'); window.close(); }

  9. Android -------- 从一个Fragment跳转到另一个Fragment

    一.直接getActivity,使用activity的fragmenttransation的replace方法替换 private void changeToAnotherFragment(){ // ...

  10. arcgis server manager - An error has occured on the server. For details please check the Event (Application) log on the web.

    当登陆 Arcgis Server Manager的时候,点击 "Services" 中的选项"Manage Services",就报错: An error h ...