Example usage for org.springframework.web.bind WebDataBinder setAllowedFields

List of usage examples for org.springframework.web.bind WebDataBinder setAllowedFields

Introduction

In this page you can find the example usage for org.springframework.web.bind WebDataBinder setAllowedFields.

Prototype

public void setAllowedFields(@Nullable String... allowedFields) 

Source Link

Document

Register fields that should be allowed for binding.

Usage

From source file:com.stephengream.simplecms.web.controllers.ProfileController.java

@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.setAllowedFields(new String[] { "username", "passwordConfirm", "email", "password" });
}

From source file:org.osiam.addons.selfadministration.registration.RegistrationController.java

@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.setAllowedFields(registrationService.getAllAllowedFields());
}

From source file:org.openmrs.module.conceptsearch.web.controller.BasicSearchFormController.java

@InitBinder("conceptQuery")
public void initBinder(WebDataBinder dataBinder) {
    dataBinder.setAllowedFields(new String[] { "conceptQuery" });
    dataBinder.setRequiredFields(new String[] { "conceptQuery" });
}

From source file:es.jffa.tsc.sip04.web.AccountController.java

/**
 * The @InitBinder annptation tells Spring Web MVC to call this method
 * when initializing the WebDataBinder responsible for binding HTTP
 * parameters to form beans./*from w ww  .  jav  a 2s.c  o  m*/
 * @param binder
 */
@InitBinder
public void initBinder(final WebDataBinder binder) {
    binder.setAllowedFields(new String[] { "username", "password", "confirmPassword", "firstName", "lastName",
            "email", "marketingOk", "acceptTerms" });
}

From source file:org.sloth.web.report.CreateReportController.java

/**
 * Sets custom parameters to the {@code WebDataBinder}.
 * /*from   w  w w.  jav  a  2s  .  c om*/
 * @param webDataBinder
 *            the {@code WebDataBinder} to initialize
 */
@InitBinder
public void initBinder(WebDataBinder webDataBinder) {
    webDataBinder.setAllowedFields("description");
}

From source file:com.denimgroup.threadfix.webapp.controller.AddDefectTrackerController.java

@InitBinder
public void setAllowedFields(WebDataBinder dataBinder) {
    dataBinder.setAllowedFields(new String[] { "name", "url", "defectTrackerType.id" });
}

From source file:com.springinpractice.ch11.web.controller.application.ApplicationPackageController.java

/**
 * @param binder//ww  w . j  a  v a  2  s.c o m
 */
@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
    binder.setAllowedFields("version");
}

From source file:com.autoupdater.server.controllers.ProgramsController.java

/**
 * Filters values passed to command object "program".
 * // w  w  w  . j av  a2  s.co  m
 * @param binder
 *            binder that will bind sent information to command object
 */
@InitBinder("program")
public void configureBindingOfProgram(WebDataBinder binder) {
    logger.debug("Securing \"program\" modelAttribute");
    binder.setAllowedFields("name");
}

From source file:com.autoupdater.server.controllers.BugsController.java

/**
 * Filters values passed to command object "bug".
 * /*from ww  w .j av a  2s.co  m*/
 * @param binder
 *            binder that will bind sent information to command object
 */
@InitBinder("bug")
public void configureBindingOfBug(WebDataBinder binder) {
    logger.debug("Securing \"bug\" modelAttribute");
    binder.setAllowedFields("description");
}

From source file:com.autoupdater.server.controllers.PackagesController.java

/**
 * Filters values passed to command object "_package".
 * /*  w w w.j a  va 2 s .c o m*/
 * @param binder
 *            binder that will bind sent information to command object
 */
@InitBinder("_package")
public void configureBindingOfPackage(WebDataBinder binder) {
    logger.debug("Securing \"_package\" modelAttribute");
    binder.setAllowedFields("name");
}