skip to content

Container Services

The supporting services the container offers beyond wiring: resource loading, type conversion and formatting, application events, message sources for i18n, and Bean Validation integration. Interviewers dip in here when they want breadth rather than Boot trivia.

part ofSpring Frameworkoverview, primer and where to startread it →
on this pageshow

explore

questions

page 2 of 2

Explain the PropertyAccessor abstraction and the difference between BeanWrapper (property access) and direct field access in DataBinder. When would you switch, and what are the tradeoffs?

level: principalimportance: nice to knowfreq 25%

basics

~10 s

PropertyAccessor is the get/set-by-name contract. BeanWrapper implements it via getters/setters; DirectFieldAccessor implements it by reflecting on fields directly. DataBinder.initDirectFieldAccess() switches from the former to the latter, so binding bypasses accessor methods.

open as a page

What are the key production pitfalls with MessageSource around MessageFormat quoting, encoding, missing keys, and the parent hierarchy?

level: principalimportance: nice to knowfreq 22%

basics

~20 s

Watch four things: single quotes must be doubled ('') only when a message has arguments; set defaultEncoding to UTF-8; decide missing-key behavior (throw vs default vs useCodeAsDefaultMessage); and set fallbackToSystemLocale=false so missing files fall back to the base bundle, not the server's locale.

open as a page

showing 31–32 of 32