Example usage for org.springframework.web.bind ServletRequestDataBinder setAutoGrowNestedPaths

List of usage examples for org.springframework.web.bind ServletRequestDataBinder setAutoGrowNestedPaths

Introduction

In this page you can find the example usage for org.springframework.web.bind ServletRequestDataBinder setAutoGrowNestedPaths.

Prototype

public void setAutoGrowNestedPaths(boolean autoGrowNestedPaths) 

Source Link

Document

Set whether this binder should attempt to "auto-grow" a nested path that contains a null value.

Usage

From source file:edu.duke.cabig.c3pr.web.EditParticipantController.java

protected void initBinder(HttpServletRequest req, ServletRequestDataBinder binder) throws Exception {
    binder.setAutoGrowNestedPaths(Boolean.FALSE);
    super.initBinder(req, binder);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("MM/dd/yyyy"), true));
    binder.registerCustomEditor(HealthcareSite.class, new CustomDaoEditor(healthcareSiteDao));
    binder.registerCustomEditor(ContactMechanismType.class, new EnumByNameEditor(ContactMechanismType.class));
    binder.registerCustomEditor(RaceCodeEnum.class, new EnumByNameEditor(RaceCodeEnum.class));
    binder.registerCustomEditor(RaceCodeAssociation.class, new CustomDaoEditor(raceCodeAssociationDao));
    binder.registerCustomEditor(Participant.class, new CustomDaoEditor(participantDao));
    binder.registerCustomEditor(FamilialRelationshipName.class,
            new EnumByNameEditor(FamilialRelationshipName.class));
    binder.registerCustomEditor(RelationshipCategory.class, new EnumByNameEditor(RelationshipCategory.class));
}

From source file:edu.duke.cabig.c3pr.web.CreateParticipantController.java

@Override
protected void initBinder(HttpServletRequest req, ServletRequestDataBinder binder) throws Exception {
    binder.setAutoGrowNestedPaths(Boolean.FALSE);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("MM/dd/yyyy"), true));
    binder.registerCustomEditor(HealthcareSite.class, new CustomDaoEditor(healthcareSiteDao));
    binder.registerCustomEditor(ContactMechanismType.class, new EnumByNameEditor(ContactMechanismType.class));
    binder.registerCustomEditor(OrganizationIdentifierTypeEnum.class,
            new EnumByNameEditor(OrganizationIdentifierTypeEnum.class));
    binder.registerCustomEditor(RaceCodeEnum.class, new EnumByNameEditor(RaceCodeEnum.class));
    binder.registerCustomEditor(RaceCodeAssociation.class, new CustomDaoEditor(raceCodeAssociationDao));
    binder.registerCustomEditor(Participant.class, new CustomDaoEditor(participantDao));
    binder.registerCustomEditor(FamilialRelationshipName.class,
            new EnumByNameEditor(FamilialRelationshipName.class));
    binder.registerCustomEditor(RelationshipCategory.class, new EnumByNameEditor(RelationshipCategory.class));
}

From source file:edu.duke.cabig.c3pr.web.study.StudyController.java

@Override
protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
    binder.setAutoGrowNestedPaths(Boolean.FALSE);
    super.initBinder(request, binder);
    binder.registerCustomEditor(Date.class, ControllerTools.getDateEditor(false));
    binder.registerCustomEditor(healthcareSiteDao.domainClass(), new CustomDaoEditor(healthcareSiteDao));
    binder.registerCustomEditor(healthcareSiteInvestigatorDao.domainClass(),
            new NullIdDaoBasedEditor(healthcareSiteInvestigatorDao));
    binder.registerCustomEditor(personUserDao.domainClass(), new NullIdDaoBasedEditor(personUserDao));
    binder.registerCustomEditor(studyDao.domainClass(), new CustomDaoEditor(studyDao));

    binder.registerCustomEditor(Integer.class, new CustomNumberEditor(Integer.class, true));
    binder.registerCustomEditor(String.class, "file", new StringMultipartFileEditor());
    binder.registerCustomEditor(byte[].class, "study.criteriaFile", new ByteArrayMultipartFileEditor());

    binder.registerCustomEditor(StudyPart.class, new EnumByNameEditor(StudyPart.class));
    binder.registerCustomEditor(ConsentRequired.class, new EnumByNameEditor(ConsentRequired.class));
    binder.registerCustomEditor(OrganizationIdentifierTypeEnum.class,
            new EnumByNameEditor(OrganizationIdentifierTypeEnum.class));
    binder.registerCustomEditor(RandomizationType.class, new EnumByNameEditor(RandomizationType.class));
    binder.registerCustomEditor(CoordinatingCenterStudyStatus.class,
            new EnumByNameEditor(CoordinatingCenterStudyStatus.class));
    binder.registerCustomEditor(InvestigatorStatusCodeEnum.class,
            new EnumByNameEditor(InvestigatorStatusCodeEnum.class));
    binder.registerCustomEditor(SiteStudyStatus.class, new EnumByNameEditor(SiteStudyStatus.class));
    binder.registerCustomEditor(EpochType.class, new EnumByNameEditor(EpochType.class));
    binder.registerCustomEditor(ConsentingMethod.class, new EnumByNameEditor(ConsentingMethod.class));
    binder.registerCustomEditor(StudySponsorType.class, new EnumByNameEditor(StudySponsorType.class));
    binder.registerCustomEditor(StudyCategory.class, new EnumByNameEditor(StudyCategory.class));
    binder.registerCustomEditor(NCIRecognizedProgramName.class,
            new EnumByNameEditor(NCIRecognizedProgramName.class));

}

From source file:edu.duke.cabig.c3pr.web.registration.RegistrationController.java

@Override
protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
    binder.setAutoGrowNestedPaths(Boolean.FALSE);
    super.initBinder(request, binder);
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
    binder.registerCustomEditor(Integer.class, new CustomNumberEditor(Integer.class, true));
    binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("MM/dd/yyyy"), true));
    binder.registerCustomEditor(HealthcareSite.class, new CustomDaoEditor(healthcareSiteDao));
    binder.registerCustomEditor(EligibilityCriteria.class, new CustomDaoEditor(studySiteDao));
    binder.registerCustomEditor(Participant.class, new CustomDaoEditor(participantDao));
    binder.registerCustomEditor(ICD9DiseaseSite.class, new CustomDaoEditor(icd9DiseaseSiteDao));
    binder.registerCustomEditor(Arm.class, new CustomDaoEditor(armDao));
    binder.registerCustomEditor(Epoch.class, new CustomDaoEditor(epochDao));
    binder.registerCustomEditor(Consent.class, new CustomDaoEditor(consentDao));
    binder.registerCustomEditor(PersonUser.class, new CustomDaoEditor(personUserDao));
    binder.registerCustomEditor(StratificationCriterionPermissibleAnswer.class,
            new CustomDaoEditor(stratificationAnswerDao));
    Object command = binder.getTarget();
    binder.registerCustomEditor(StudyDisease.class,
            new ObjectGraphBasedEditor(command, "studySubject.studySite.study.studyDiseases"));
    binder.registerCustomEditor(StudyInvestigator.class, new CustomDaoEditor(studyInvestigatorDao));
    binder.registerCustomEditor(ScheduledEpoch.class, new CustomDaoEditor(scheduledEpochDao));
    binder.registerCustomEditor(RandomizationType.class, new EnumByNameEditor(RandomizationType.class));
    binder.registerCustomEditor(RegistrationDataEntryStatus.class,
            new EnumByNameEditor(RegistrationDataEntryStatus.class));
    binder.registerCustomEditor(RegistrationWorkFlowStatus.class,
            new EnumByNameEditor(RegistrationWorkFlowStatus.class));
    binder.registerCustomEditor(ScheduledEpochDataEntryStatus.class,
            new EnumByNameEditor(ScheduledEpochDataEntryStatus.class));
    binder.registerCustomEditor(ScheduledEpochWorkFlowStatus.class,
            new EnumByNameEditor(ScheduledEpochWorkFlowStatus.class));
    binder.registerCustomEditor(ICD9DiseaseSiteCodeDepth.class,
            new EnumByNameEditor(ICD9DiseaseSiteCodeDepth.class));
    binder.registerCustomEditor(OrganizationIdentifierTypeEnum.class,
            new EnumByNameEditor(OrganizationIdentifierTypeEnum.class));
    binder.registerCustomEditor(ConsentingMethod.class, new EnumByNameEditor(ConsentingMethod.class));
    binder.registerCustomEditor(Reason.class, new CustomDaoEditor(reasonDao));
    binder.registerCustomEditor(ConsentingMethod.class, new EnumByNameEditor(ConsentingMethod.class));
    binder.registerCustomEditor(AMPMEnum.class, new EnumByNameEditor(AMPMEnum.class));
    binder.registerCustomEditor(TimeZoneEnum.class, new EnumByNameEditor(TimeZoneEnum.class));
}