`
lgstarzkhl
  • 浏览: 329800 次
  • 性别: Icon_minigender_1
  • 来自: 沈阳
社区版块
存档分类
最新评论

不显示删除回复显示所有回复显示星级回复显示得分回复 使用Struts时,遇到的问题

阅读更多
抛出的异常如下
2009-11-10 04:38 ERROR org.apache.struts.actions.DispatchAction - Request[/sysm/
module/module] does not contain handler parameter named 'method'.  This may be caused by whitespace in the label text.
2009-11-10 04:55 ERROR org.apache.struts.actions.DispatchAction - Request[/sysm/
module/module] does not contain handler parameter named 'method'.  This may be c
aused by whitespace in the label text.

后来找了一下问题有这么几种可能

01  这个原因是.你用DispatchAction这个类的话 form 表单里面,如果不设置method方法为post 的话.就会出现这样的问题,用改用GET方式请求试一下.就可以重现了


02  does not contain handler parameter named 'method'.    This may be caused by whitespace in the label text  
这个异常往往是大家对DispatchAction 不熟悉造成,
a 在用它的时候别忘记了在STRUTS-CONFIG中的<action>属性加parameter="method",
b   还有<html:form>和普通的<form>是有区别的,在用form提交表单的时候别忘记要家范围method="post",不然也会有错,
c 还有在action.do?method=XXXX这个中间不要有空格! 

03 可能是js和button的动作冲突了。
<input   type= "submit "   name= "Submit "   value= "toExcel "   onClick= "set( 'toExcel ') "/>
这里,既提交了表单,又想改变action域的值,你确定提交表单动作是在改变域值之后么? 
<input   type= "button "   name= "Submit "   value= "toExcel "   onClick= "set( 'toExcel ') "/>


function   set(   target){
var   form   =   document.forms[0];
form.action.value=target;
document.forms[0].submit();
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics