防止在struts中多次提交表单

时间:2012-01-15 19:36:27

标签: struts submission

我正在struts中开发struts 1.3中的应用程序我有一个要求,当单击表单的提交按钮时,按钮被禁用,因此用户无法多次提交表单,因为我正在使用此代码< / p>

<input value="Save" class="btnbg" type="submit" name="method" 
                           onclick="this.disabled=true;"  />

在此代码中点击按钮它被禁用现在它被禁用但我面临一个特殊的问题,即动作类中的动作没有执行我使用DispatchAction类来执行我的动作它的代码工作正常我删除onclick =“this.disabled = true;操作被执行但我得到异常

   javax.servlet.ServletException: Request[/AddFloor] does not contain handler    parameter named 'method'.  This may be caused by whitespace in the label text.
org.apache.struts.actions.DispatchAction.unspecified(DispatchAction.java:197)
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:245)
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
com.asset.filter.CheckSession.doFilter(CheckSession.java:72)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)

我不明白发生了什么

0 个答案:

没有答案