String checkType = (String)request.getAttribute("checkType");
String checkTypeIDStr = checkType.substring(0, checkType.indexOf(";"));
String checkTypeCode = checkType.substring(checkType.indexOf(";")+1);
Check check = new Check();
check.setCheckId(checkId);
check.setDescription(description);
check.setName(name);
check.setLabel(label);
check.setValueTypeId(Integer.valueOf(checkTypeIDStr));
check.setValueTypeCd(checkTypeCode);
String fieldValue1Name = checkTypeCode+"_value1";
String fieldValue2Name = checkTypeCode+"_value2";
String value1 = (String)request.getAttribute(fieldValue1Name);
String value2 = (String)request.getAttribute(fieldValue2Name);
if (value1!=null && value1.length()<400)check.setFirstValue(value1);
if (value2!=null && value2.length()<400)check.setSecondValue(value2);
labelControl(label, checkId);
return check;