class org.springframework.web.bind.ServletRequestBindingException' binderId'不存在

时间:2015-10-06 11:35:37

标签: java spring servlets controller

当我尝试从网站下载报告(PDF)时,有人能告诉我为什么会收到此错误消息。由于我是Spring框架的初学者,我无法弄清楚为什么会出现此错误消息。要求澄清我。提前谢谢。

错误讯息:

常规错误

请与您的系统管理员联系以获取帮助。

  

class org.springframework.web.bind.ServletRequestBindingException   所需的长参数' binderId'不存在

显示详细信息

  

org.springframework.web.bind.ServletRequestBindingException:必需   长参数&binder;' binderId'不在场   org.springframework.web.bind.RequestUtils $ ParameterParser.validateRequiredParameter(RequestUtils.java:558)   在   org.springframework.web.bind.RequestUtils $ ParameterParser.parse(RequestUtils.java:544)   在   org.springframework.web.bind.RequestUtils $ LongParser.parseLong(RequestUtils.java:609)   在   org.springframework.web.bind.RequestUtils.getRequiredLongParameter(RequestUtils.java:200)   在   com.sitescape.team.servlet.forum.ViewFileController.handleRequestAfterValidation(ViewFileController.java:135)   在   com.sitescape.team.web.servlet.SAbstractController.handleRequestInternal(SAbstractController.java:206)   在   org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)   在   org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)   在   org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:740)   在   org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:684)   在   org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:394)   在   org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:348)   在javax.servlet.http.HttpServlet.service(HttpServlet.java:690)at   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)at at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)   在   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)   在   com.sitescape.team.web.servlet.filter.LoginFilter.doFilter(LoginFilter.java:56)   在   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)   在   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)   在   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)   在   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)   在   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)   在   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)   在   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)   在   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)   在   org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)   在org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)   在org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)   在   org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)   在   org.apache.jk.common.ChannelSocket $ SocketConnection.runIt(ChannelSocket.java:895)   在   org.apache.tomcat.util.threads.ThreadPool $ ControlRunnable.run(ThreadPool.java:685)   在java.lang.Thread.run(Thread.java:722)

1 个答案:

答案 0 :(得分:1)

  

org.springframework.web.bind.ServletRequestBindingException:必需   长参数' binderId'不在

我猜您的控制器参数中有@RequestParam("binderId"),使用此配置时,binderId将是必需的。作为此问题的解决方法,您应该传递binderId参数或将参数设为optional,如下所示:

@RequestParam(value = "binderId", required = false)