SSH菜鸟找高手 2010-04-20 11:50:29,406 ERROR [org.apache.struts.actions.DispatchAction] - Request[/role] does not contain handler parameter named 'operate'. This may be caused by whitespace in the label text.请问这个异常是怎么回事?分全是你的... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 parameter这个你传了什么值过去 啊啊,我的回复没显示呢…………LZ,parameter你传了什么值过去啊 你可能忘记在struts-config.xml中设置parameter="method"参数了, 这个参数你可以随便用一个字符串,并且在JSP页面中,你可能忘记了<input type=hidden name=method value="你要在继承DispatchAction超类的Action子类的方法"这样就可以了, 没有找到operate这个东西,有可能是你的这个名字前台传的时候前后出现空格 用struts2做的?配置文件没错? <script type="text/javascript"> function doDel(userId){ if( ! confirm("是否删除") ){ return false; } window.location.href="${ path }/user.do?operate=doDel& userId="+userId; } function toAdd(){ window.location.href="${ path }/user.do?operate= toAdd"; } function doCheck(){ document.forms[0].submit(); } </script> </head> <body><tagUtil:erralert errcode="msg"/> <div class="page_title"> 用户管理 </div> <div class="button_bar"> <button class="common_button" onclick="toAdd()"> 新建 </button> <button class="common_button" onclick="doCheck();"> 查询 </button> </div> <html:form action="/user" method="post" > <input type="hidden" name="operate" value="toList" /> <table class="query_form_table"> <tr> <th> 用户名: </th> <td> <html:text property="user.userName"></html:text> </td> <th> 状态 </th> <td> <html:select property="user.usrFlag"> <html:option value="-1">全部</html:option> <html:option value="0">已删除</html:option> <html:option value="1">正常</html:option> </html:select> </td> </tr> </table> <struts-config> <form-beans> <form-bean name="userForm" type="com.crm.auth.web.form.UserForm" /> <form-bean name="roleForm" type="com.crm.auth.web.form.RoleForm" /> </form-beans> <action-mappings> <action parameter="operate" name="RoleForm" path="/role" scope="request"> <forward name="toList" path="/jsp/auth/rolelist.jsp"></forward> </action> <action input="/login.jsp" parameter="operate" name="userForm" path="/user" scope="request"> <forward name="toList" path="/jsp/auth/userlist.jsp"></forward> </action> </action-mappings></struts-config> <html:form action="/user这里没这个属性‘operate’" method="post" > 他提示的是role你是在哪里请求的role呢 <html:form action="/user" method="post" ><input type="hidden" name="operate" value="toList" />有operate啊 在线等,SSH中的配置问题,老出错,求高手。。QQ:386804996 jsp 判断问题 求高手来!! 求 java表单 高分求救!!Axis1.4支持jms协议版本问题! [讨论]容器启动后,会有几个servlet实例? 请高手指点 配置数据源 如何配置以及 如何使用 连接池. struts中html:form如何调用javascript 正则表达式如何实现以下功能 windowsXP系统下jdbc驱动连接sqlserver2000的问题。 求教:如何实现网站自动登陆的小软件 多文件上传时,是否有顺序问题? 测试hibernate出现问题,寻求解决
这样就可以了,
function doDel(userId){
if( ! confirm("是否删除") ){
return false;
}
window.location.href="${ path }/user.do?operate=doDel& userId="+userId;
}
function toAdd(){
window.location.href="${ path }/user.do?operate= toAdd";
}
function doCheck(){
document.forms[0].submit();
}
</script>
</head>
<body>
<tagUtil:erralert errcode="msg"/>
<div class="page_title">
用户管理
</div>
<div class="button_bar">
<button class="common_button" onclick="toAdd()">
新建
</button>
<button class="common_button" onclick="doCheck();">
查询
</button>
</div>
<html:form action="/user" method="post" >
<input type="hidden" name="operate" value="toList" />
<table class="query_form_table">
<tr>
<th>
用户名:
</th>
<td>
<html:text property="user.userName"></html:text>
</td>
<th>
状态
</th>
<td>
<html:select property="user.usrFlag">
<html:option value="-1">全部</html:option>
<html:option value="0">已删除</html:option>
<html:option value="1">正常</html:option>
</html:select>
</td>
</tr>
</table>
<form-beans>
<form-bean name="userForm"
type="com.crm.auth.web.form.UserForm" /> <form-bean name="roleForm"
type="com.crm.auth.web.form.RoleForm" />
</form-beans> <action-mappings>
<action parameter="operate" name="RoleForm"
path="/role" scope="request">
<forward name="toList" path="/jsp/auth/rolelist.jsp"></forward>
</action>
<action input="/login.jsp" parameter="operate" name="userForm"
path="/user" scope="request">
<forward name="toList" path="/jsp/auth/userlist.jsp"></forward>
</action>
</action-mappings></struts-config>
你是在哪里请求的role呢
<input type="hidden" name="operate" value="toList" />
有operate啊