问题是这样的,productType这个action里面有一个private PageView<ProductType> pageView;属性,我想把pageView的信息转入到brand这个action里面的private PageView<ProductType> productTypePageView;,如下操作: <action name="productType" class="productTypeAction">
<result name="success">/WEB-INF/admin/product/productList.jsp</result>
<result name="ProductToBrand" type="redirectAction">
<param name="actionName">brand</param>
<param name="productTypePageView">${pageView}</param>
</result>
</action>
<action name="brand" class="brandAction">
<result name="success">/WEB-INF/admin/product/brandList.jsp</result>
</action>
报错如下:警告: Error setting expression 'productTypePageView' with value '[Ljava.lang.String;@f21478'
ognl.MethodFailedException: Method "setProductTypePageView" failed for object cn.lazybook.web.action.product.BrandAction@85a863 [java.lang.NoSuchMethodException: cn.lazybook.web.action.product.BrandAction.setProductTypePageView([Ljava.lang.String;)]
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1285)我知道报错的意思是我${pageView}提取的信息是个String类型的。但很郁闷为什么会这样,类型明明是PageView<ProductType>的,请高手们帮忙解决这个问题!actionstrutsjava参数传递
<result name="success">/WEB-INF/admin/product/productList.jsp</result>
<result name="ProductToBrand" type="redirectAction">
<param name="actionName">brand</param>
<param name="productTypePageView">${pageView}</param>
</result>
</action>
<action name="brand" class="brandAction">
<result name="success">/WEB-INF/admin/product/brandList.jsp</result>
</action>
报错如下:警告: Error setting expression 'productTypePageView' with value '[Ljava.lang.String;@f21478'
ognl.MethodFailedException: Method "setProductTypePageView" failed for object cn.lazybook.web.action.product.BrandAction@85a863 [java.lang.NoSuchMethodException: cn.lazybook.web.action.product.BrandAction.setProductTypePageView([Ljava.lang.String;)]
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1285)我知道报错的意思是我${pageView}提取的信息是个String类型的。但很郁闷为什么会这样,类型明明是PageView<ProductType>的,请高手们帮忙解决这个问题!actionstrutsjava参数传递
解决方案 »
- 如何让IE一打开就全屏显示,按F11那种
- org.apache.jasper.JasperException: Template /template/ajax/text.ftl not found
- 新手路径小问题
- selvet在MyEclipse下能运行,放到eclipse jee下就不行了
- 学JMX和JINI这两个技术不知道用处大不大?
- 这个Java正则匹配哪里出错了?
- 关于STRUTS标签嵌套问题~
- 初学JSP,配好了JDK1.5 tomcat5.5后.......
- 紧急求救:用jspSmartUpload进行文件的上传,如何配置resin?
- 谁帮我看看这代码哪里的问题?谢谢大哥大姐了。
- struts2.1.8 客户端验证的问题
- 关于SSH配置
如果改为chain的话就不报错了,但是brandAction里面productTypePageView没有被传值,它是个null!
type="chain"也没有解决问题呀。可以跟你讨论一下吗?
http://www.blogjava.net/sxyx2008/archive/2010/01/12/309151.html