Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Nov 30, 2010 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 30, 2010

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

@spring-projects-issues
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants