Skip to content

Provide a formatter registry capability local to a controller [SPR-7773] #12429

Closed

Description

@spring-projects-issues

Rossen Stoyanchev opened SPR-7773 and commented

Currently a single ConversionService is used globally in a DispatcherServlet. It would be useful for controllers to be able to register converters and formatters locally for a given DataBinder instance without affecting the global ConversionService instance (for example ROO-1655).

Something along the lines of:
DataBinder.getFormatterRegistry().add(..)


Affects: 3.0.5

Issue Links:

Referenced from: commits dc39e35, 02da2e8

4 votes, 5 watchers

Activity

  1. spring-projects-issues commented on May 12, 2015

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    I'm introducing addCustomFormatter(Formatter formatter, String... fields) and addCustomFormatter(Formatter formatter, Class... fieldTypes) to DataBinder, internally adapting the given Formatter to a PropertyEditor and registering that adapter with the underlying PropertyEditorRegistry, following the usual rules there. This is a quite simple and straighforward approach which should hopefully cover the typical use case here, without having to build an extra local ConversionService underneath the covers.

    Juergen

  2. added
    type: enhancement
    in: web
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webtype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions