- @SuppressWarnings("unchecked")
- Map<String, String> map=request.getParameterMap();//获得请求参数集合
- Method method=null;
- method=map.getClass().getDeclaredMethod("setLocked",boolean.class); //获得修改 参数锁定状态的方法,如果不修改锁定状态是不能修改参数集合的
- if(method!=null)
- {
- method.invoke(map,false); //设置为未锁定
- map.put("user.password", trypwd); //向集合里面放入请求参数
- map.put("user.username", tryusername);
- map.put("atulogin", "true");
- request.getRequestDispatcher("user/Login_action.htm").forward(request, response); //转发到另一个页面,在另一个页面可以使用request.getParamter()获得这些参数
- //该片段来自于http://www.codesnippet.cn/detail/2110201513859.html
来源: http://www.codesnippet.cn/detail/2110201513859.html