我正在开发基于struts的应用程序。在一个页面上,我发送一个带有POST请求的动态表单,该表单需要多个参数(单选按钮和隐藏表单字段)。当我点击提交按钮时,它会显示一个空白页面。我调查了关于chrome的问题并发现它是一个例外:
javax.servlet.ServletException: javax.servlet.ServletException: Request[/MMSP] does not contain handler parameter named 'form_action'. This may be caused by whitespace in the label text.
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:446)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
javax.servlet.ServletException: Request[/MMSP] does not contain handler parameter named 'form_action'. This may be caused by whitespace in the label text.
org.apache.struts.actions.DispatchAction.unspecified(DispatchAction.java:194)
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:242)
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:167)
org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:53)
org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:64)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:446)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
为了确保提供了handler参数,我在JSP页面中检查它并提供了它。
<input type="hidden" name="form_action" value="funcName">
但我仍然遇到这个错误。我的问题与参数数量的POST参数限制有关,因为该请求带有超过600个参数。请求是否有可能丢失导致此问题的最后几个参数。
注意:我的应用程序部署在Tomcat-8上,我们最近将Tomcat版本从7升级到8.