monitor client support

This commit is contained in:
wenshao
2013-08-15 01:30:48 +08:00
parent f8b1914c4a
commit bc83ad4ebc
3 changed files with 233 additions and 13 deletions
@@ -29,6 +29,8 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;
import javax.servlet.GenericServlet;
public class Utils {
public final static int DEFAULT_BUFFER_SIZE = 1024 * 4;
@@ -168,6 +170,16 @@ public class Utils {
}
return null;
}
public static Boolean getBoolean(GenericServlet servlet, String key) {
String property = servlet.getInitParameter(key);
if ("true".equals(property)) {
return Boolean.TRUE;
} else if ("false".equals(property)) {
return Boolean.FALSE;
}
return null;
}
public static Integer getInteger(Properties properties, String key) {
String property = properties.getProperty(key);