request.getParameter与Bean的错误

HTTP Status 500 – Internal Server Error


Type Exception Report

Message java.lang.reflect.InvocationTargetException

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException//反射异常,记住一定要键值一一对应且Bean类型要符合规范,最后这里解决方法是
	cn.maple.tools.BaseServlet.service(BaseServlet.java:58)            需反射类中补回没有添加的表单数据
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
		  Map map = request.getParameterMap();  
		    Map output = new HashMap();  
		    for(Entry entry : map.entrySet()) {  
		        output.put(entry.getKey(), entry.getValue()[0]);  
		    }  //第二种解决方法:补充两个map类之间的传值,此处是因为getParametermap只读,不能修改,所以以新map代替

Root Cause

java.lang.reflect.InvocationTargetException
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:498)
	cn.maple.tools.BaseServlet.service(BaseServlet.java:33)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

Root Cause

java.lang.IllegalStateException: No modifications are allowed to a locked ParameterMap
	org.apache.catalina.util.ParameterMap.checkLocked(ParameterMap.java:175)
	org.apache.catalina.util.ParameterMap.remove(ParameterMap.java:168)
	test.test.fun(test.java:27)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:498)
	cn.maple.tools.BaseServlet.service(BaseServlet.java:33)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

Note The full stack trace of the root cause is available in the server logs.

你可能感兴趣的:(request.getParameter与Bean的错误)