1.使用findBug
2.public static void returnHttpMsg(HttpServletResponse response, Object bean)
{
PrintWriter out = null;
try{
LogManager.appendBiz_before_change("http");
String xml = XmlBeanServer.beanToXml(bean);
System.out.print(xml);
response.setCharacterEncoding("GBK");
out = response.getWriter();
out.write(xml);
out.flush();
}catch (IOException e){
e.printStackTrace();
}
finally{
if (null !=out){
out.close();
}
}
}
public static Map<String,String> parseParameters(Map<String,String[]> paramMap){
Map<String,String> resultMap = new HashMap<String,String>();
if (paramMap != null){
StringBuilder buffer = new StringBuilder(32);
String[] values;
for(Entry<String,String[]> entry :paramMap.entrySet()){
values = entry.getValue();
if (values != null && values.length>0){
for (int i=0;i<values.length;i++){
buffer.append(values[i].append(',');
}
}
resultMap.put(entry.getKey(),buffer.substring(0,buffer.length()>0?buffer.length()-1:0));
buffer.delete(0,buffer.length());
}
}
return resultMap;
}