java.lang.NumberFormatException: For input string:
写测试时用占位符 MessageFormat.format 输出报错
仔细查看了一下我的语句
System.out.println(MessageFormat.format( "{method:{0}.{1},params:{2},user:[id:{3},username:{4}],ip:{5},dateTime:{6},operationCode:{7},type:{8},creater:{9},requestUrl:{10}}" ,cla,method,json.toString(),userid,username,ip,new Date().getTime(),"ceshi",request.getMethod(),"ceshiCreater",request.getRequestURL()));
发现format不允许{..{0}...}这样的形式,然后我改成了...{0}...
System.out.println(MessageFormat.format( "method:{0}.{1},params:{2},user:[id:{3},username:{4}],ip:{5},dateTime:{6},operationCode:{7},type:{8},creater:{9},requestUrl:{10}" ,cla,method,json.toString(),userid,username,ip,new Date().getTime(),"ceshi",request.getMethod(),"ceshiCreater",request.getRequestURL()));
运行成功了
像这一类的错误都是非常小的点,只能多经历才能避免了