struts的ognl.NoConversionPossible错误
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错误的更多相关文章
- Struts 2 OGNL
1.什么是OGNL? 2.Struts 2 OGNL 表达式 ====================== 华丽丽的分割线 ====================== 1.什么是OG ...
- struts基于ognl的自动类型转换需要注意的地方
好吧,坎坷的过程我就不说了,直接上结论: 在struts2中使用基于ognl的自动类型转换时,Action中的对象属性必须同时添加get/set方法. 例如: 客户端表单: <s:form ac ...
- ognl版本错误
错误信息: 2014-2-6 21:20:10 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() fo ...
- struts与ognl结合【重要】
-----------------------------ognl表达式------------------------ OGNL:对象视图导航语言. ${user.addr.name} 这种写法就 ...
- java框架篇---struts之OGNL详解
OGNL(Object Graph Navigation Language),是一种表达式语言.使用这种表达式语言,你可以通过某种表达式语法,存取Java对象树中的任意属性.调用Java对象树的方法. ...
- 关于struts中Ognl和iterator配合再次理解
Person.jsp (struts.xml中省略) package com.mzy.entity; public class Person { private String name; privat ...
- struts(三) ---OGNL的学习和理解
OGNL:Object graphic Navgation Language(对象图形的导航语言)
- myeclipse 右键 Add Struts... 页面报404 错误
网上试了很多种方法都不对,结果老师两下点出来了 我的改正方法是: 将WebRoot/WEB-INF/web.xml中的 <url-pattern>/*</url-pattern> ...
- 在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 ...
随机推荐
- Ubuntu16.04下部署 nginx+uwsgi+django1.9.7(虚拟环境pyenv+virtualenv)
由于用的新版本系统,和旧的稍有差别,在网上搜了很多相关资料,搞了三天终于搞好在Ubuntu16.04下的部署,接下来就详细写写步骤以及其中遇到的问题.前提是安装有虚拟环境pyenv+virtualen ...
- [Angular 2] Using Promise to Http
You can also use Promise for http: So for the service, you need to call toPromise() method: getVehic ...
- 2d-x中Lua类型强转问题
在Lua中,使用CCDictionary进行保存CCSprite对象,但是,在CCDictionary取出来的时候,此时是一个CCObject对象,无法调用子类精灵的一些方法.那只能进行强转的. 那么 ...
- 自定义key解决zabbix端口监听取值不准确的问题
今天有一个朋友问到我一个关于zabbix监控tcp端口的问题,明明端口在监听,但是通过net.tcp,listen取值取到的却是0. 经过简单的goole发现这已经是一个历史悠久的问题: 问 ...
- css单位rem---移动端至宝
1.rem是什么? rem(font size of the root element)是指相对于根元素的字体大小的单位.简单的说它就是一个相对单位.看到rem大 家一定会想起em单位em(font ...
- (转)js 中{},[]中括号,大括号使用详解
一.{ } 大括号,表示定义一个对象,大部分情况下要有成对的属性和值,或是函数. 如:var LangShen = {"Name":"Langshen",&qu ...
- Resharper
http://baike.baidu.com/link?url=H8DVtrvKV1Cg-Hrz82C6ZiJOUXbi_3BfoROe-RlHhctPna4-BFfglPh2OsR-KmCqRZ7_ ...
- .NET中使用GridView控件输入数据时出现“ Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"的问题
在.NET中使用GridView控件的在线编辑数据时,出现了“ Index was out of range. Must be non-negative and less than the size ...
- C++中的析构函数
代码: #include <cstdio> #include <iostream> using namespace std; class A{ public: ~A(){ co ...
- JavaScript学习笔记(三十八) 复制属性继承
复制属性继承(Inheritance by Copying Properties) 让我们看一下另一个继承模式—复制属性继承(inheritance by copying properties).在这 ...