如何快速开发CANOpen接口?
发布网友
发布时间:2022-04-28 17:26
我来回答
共1个回答
热心网友
时间:2022-06-20 23:18
java.lang.IllegalStateException: No modifications are allowed to a locked ParameterMap。网上查了一些资料,解决方案是使用Wrapper,重写HttpServletRequestWrapper,如下:
Java代码 收藏代码
package com.gdcn.bpaf.security.yale;
import java.util.Enumeration;
import java.util.Map;
import java.util.Vector;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
@SuppressWarnings("unchecked")
public class ParameterRequestWrapper extends HttpServletRequestWrapper {
private Map params;
public ParameterRequestWrapper(HttpServletRequest request, Map newParams) {
super(request);
this.params = newParams;
}
public Map getParameterMap() {
return params;
}
public Enumeration getParameterNames() {
Vector l = new Vector(params.keySet());
return l.elements();