javax.servlet.ServletException: Request[/usergetinfo] does not contain handler parameter named 'para

简介: 错误介绍:1:找不到配置的(DispatchAction)方法参数,或者其他参数。  eg:parameter=“method”;                    2:过滤器中“ chain.doFilter(request,response);”传递不了下一个过滤器中或者,进入请求中。 异常详细信息: 2015-01-16 17:18:02,424 ERROR org.apa

错误介绍:1:找不到配置的(DispatchAction)方法参数,或者其他参数。  eg:parameter=“method”;

                   2:过滤器中“ chain.doFilter(request,response);”传递不了下一个过滤器中或者,进入请求中。

异常详细信息:

2015-01-16 17:18:02,424 ERROR org.apache.struts.actions.DispatchAction Request[/usergetinfo] does not contain handler parameter named 'param'.  This may be caused by whitespace in the label text.
2015-1-16 17:18:02 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet action threw exception
javax.servlet.ServletException: Request[/usergetinfo] does not contain handler parameter named 'param'.  This may be caused by whitespace in the label text.
	at org.apache.struts.actions.DispatchAction.unspecified(DispatchAction.java:215)
	at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:249)
	at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.ts.filter.EncodingFilter.doFilter(EncodingFilter.java:79)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
	at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:852)
	at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:584)
	at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
	at java.lang.Thread.run(Thread.java:619)

原因分析:

1:jsp中<form action="usergetinfo.do?param=getHtmlUserInfo">这种传递参数不能成功。
2:js中userForm.action = path+"/usergetinfo.do?param=getHtmlUserInfo";
       userForm.method = "get";
       userForm.submit();这种传递参数不能成功。

解决办法:

1:post:

<form action="usergetinfo.do?param=getHtmlUserInfo" method="post">...

  get:

<form action="usergetinfo.do" method="get">
 <input type="hidden" id="param" name="param" value="getHtmlUserInfo" />...

2:如果js(get)提交,在jsp的form表单中添加:

<!--jsp-->
<input type="hidden" id="param" name="param" value="getHtmlUserInfo" />
//js
  userForm.action = path+"/usergetinfo.do";
  userForm.method = "get";
  userForm.submit();

3:如果js(post)提交,不用隐藏域,直接写:

  var userForm = $("#userform").get(0);
  userForm.action = path+"/usergetinfo.do?param=getHtmlUserInfo";//或者userForm.action = "usergetinfo.do?param=getHtmlUserInfo";
  userForm.method = "post";
  userForm.submit()

注:如果,用get方式提交,<form>下submit,还是js提交,都要在form表单中添加,一个method parameter的隐藏域提交。

注:如果request找不到路径可添加:

<!--jsp-->
<input id="contextPath" type="hidden" value="${pageContext.request.contextPath }" />
//js
var path = $("#contextPath").val();

 

目录
相关文章
|
14天前
spring3 springfox报错Type javax.servlet.http.HttpServletRequest not present
spring3 springfox报错Type javax.servlet.http.HttpServletRequest not present
349 0
|
5天前
|
存储 Java 应用服务中间件
Servlet执行流程&生命周期&方法介绍&体系结构、Request和Response的功能详解(2)
Servlet执行流程&生命周期&方法介绍&体系结构、Request和Response的功能详解
15 2
|
5天前
|
Web App开发 XML Java
Servlet执行流程&生命周期&方法介绍&体系结构、Request和Response的功能详解(1)
Servlet执行流程&生命周期&方法介绍&体系结构、Request和Response的功能详解
20 2
|
14天前
|
应用服务中间件 Linux
org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nes
org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nes
37 0
|
7月前
|
Java 应用服务中间件
线上临时文件夹报错Failed to parse multipart servlet request; nested exception is java.lang.RuntimeException: java.nio.file.NoSuchFileException
Failed to parse multipart servlet request; nested exception is java.lang.RuntimeException: java.nio.file.NoSuchFileException、tmp、配置文件指定目录
136 0
|
8月前
|
XML 开发框架 Java
Java Web 项目入门指南(http、Servlet、Request、Response、ServletContext、会话技术[cookie、session]、Filter、Listener)
Java Web 项目入门指南(http、Servlet、Request、Response、ServletContext、会话技术[cookie、session]、Filter、Listener)
|
14天前
Request通用方式获取请求参数及Servlet模板创建
Request通用方式获取请求参数及Servlet模板创建
30 0
|
14天前
|
Web App开发 前端开发 JavaScript
AJAX POST请求中参数以form data和request payload形式在servlet中的获取方式
AJAX POST请求中参数以form data和request payload形式在servlet中的获取方式
35 0
|
8月前
|
XML 监控 Java
Java Web 项目入门指南(http、Servlet、Request、Response、ServletContext、会话技术[cookie、session]、Filter、Listener)4
Java Web 项目入门指南(http、Servlet、Request、Response、ServletContext、会话技术[cookie、session]、Filter、Listener)4
|
8月前
|
存储 安全 Java
Java Web 项目入门指南(http、Servlet、Request、Response、ServletContext、会话技术[cookie、session]、Filter、Listener)3
Java Web 项目入门指南(http、Servlet、Request、Response、ServletContext、会话技术[cookie、session]、Filter、Listener)3