コード例 #1
0
 static String getStringParameter(WebRequest request, String name) {
   String p;
   if ((p = request.getParameter(name)) != null) {
     return p;
   } else {
     return "";
   }
 }
コード例 #2
0
 static int parseIntParameter(WebRequest request, String name, int ifMissing) {
   String p;
   if ((p = request.getParameter(name)) != null) {
     try {
       return asInt(p);
     } catch (NumberFormatException ee) {
       logger.error(
           new StringWriter()
               .append("Could not cast event property '")
               .append(name)
               .append(": ")
               .append(p)
               .append("' to int")
               .toString());
       return ifMissing;
     }
   } else {
     return ifMissing;
   }
 }