Integer newShiftId = dynaActionForm.get("newShiftId") == null ? null : new Integer((String) dynaActionForm.get("newShiftId"));
final String newShiftIdString = (String) dynaActionForm.get("newShiftId"); Integer newShiftId = newShiftIdString == null || newShiftIdString.length() == 0 ? null : Integer.valueOf(newShiftIdString);
    public ActionForward changeStudentsShift(ActionMapping mapping, ActionForm form,            HttpServletRequest request, HttpServletResponse response) throws Exception {        IUserView userView = SessionUtils.getUserView(request);        DynaActionForm dynaActionForm = (DynaActionForm) form;        Integer oldShiftId = new Integer((String) dynaActionForm.get("oldShiftId"));        Integer newShiftId = dynaActionForm.get("newShiftId") == null ? null : new Integer((String) dynaActionForm.get("newShiftId"));        final String[] studentIDs = (String[]) dynaActionForm.get("studentIDs");        final Set<Registration> registrations = new HashSet<Registration>();        if (studentIDs != null) {            for (final String studentID : studentIDs) {                final Integer id = Integer.valueOf(studentID);                final Registration registration = rootDomainObject.readRegistrationByOID(id);                registrations.add(registration);            }        }        Object args[] = { userView, oldShiftId, newShiftId, registrations };        ServiceUtils.executeService(userView, "ChangeStudentsShift", args);        return mapping.findForward("Continue");    }