public class WebUtils{
public static<T> T request2bean(HttpServletRequest request ,Class<T> beanClass ){
T bean =beanClass.newInstance();
Enumeration e=request.getParameterNames();
while (e.hasMoreElement()){
String name=e.nextElement();
String value=request.getParameter(name);
}
}
}
我想问的是为什么把request封装到bean里面 参数是beanclass 获得一个实例 bean为什么是beanClass.newInstance 谢谢 菜鸟求助 |