分类: Struts预览模式: 普通 | 列表
错误 :javax.servlet.ServletException: DispatchMapping[0] does not define a handler property
原因: action参数配置不全
解决方法:在 config文件中 添加 parameter="method"等

错误: 表单数据验证失败时发生错误,“No input attribute for mapping path”
原因:action中表单验证 validate="true" ,如果validate()返回非空的ActionErrors,将会被转到input属性指定的URI,而action中未指定input时会报此错
解决方法:添加 input="url" 或者 validate="false"

错误:jsp页面中,一个form有隐藏的method属性,<input type="hidden" name="method" value="<bean:message key="button.deleteall"/>"> ,当其他的button使用 method时会默认为使用该属性,则达不到程序员预期的操作

查看更多...

Tags: DispatchMapping Exception

分类:Struts | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 554
08-09
10

Cannot create iterator for this collection

at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:265)
jsp文件如下:
<logic:notEmpty name="graduateList" >
<logic:iterate id="graduate" name="graduateList" >
</ogic:notEmpty >
</ogic:iterat>

graduateList是一个类,而logic:iterator要求必须是ArrayList,HashSet....这样的集合类,而graduateList中一个属性是ArrayList或HashSet的
应改为:
<logic:notEmpty name="graduateList" property="items">

查看更多...

分类:Struts | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1510
08-08
16

Unable to find setter method for attribute:xxx

1. 检查 tld 配置文件有否写对 scope 属性

2. 重点:检查 tag 类该属性的 getter & setter ,看看是否有如下方法:

public void setScope(String scope);

如果有 getScope() 方法,其返回值只能是 String 而不是其他类型。譬如以下的 getter 是错的:

public StorageScope getScope();

查看更多...

Tags: setter method TAG

分类:Struts | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 841
08-07
31

ERROR - Error creating form bean of class com.blur

javax.servlet.jsp.JspException: Exception creating bean of class com.blur.myStruts.form.productForm: {1}

struts-config.xml配置文件中的<form-bean>没有定义正确,

本次我是写成了这样

   <form-bean name="productForm"
            type="com.blur.myStruts.form.productForm" />

查看更多...

Tags: creating form

分类:Struts | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1719
08-07
25

struts运用jstl标签传多个参数

用struts传多个参数的方法,大家的思路都是将变量存到HashMap中然后再传参,就像以下代码。

<%
java.util.HashMap newValues = new java.util.HashMap();
newValues.put("floatProperty", new Float(444.0));
newValues.put("intProperty", new Integer(555));
newValues.put("stringArray", new String[]
{ "Value1", "Value2", "Value3" });
pageContext.setAttribute("newValues", newValues);

查看更多...

Tags: map hashmap

分类:Struts | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 791
08-07
08

Unable to load tag handler class "xxx" for tag "xxx"

简单的来说,就是没有找到自定义的类
检查下tld文件指定package有没有错,再检查该class是否存在

Tags: TAG 自定义标签

分类:Struts | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 929