官术网_书友最值得收藏!

Configuring custom type formatters

Mostly because of its statefulness and lack of thread safety, since version 3, Spring has added a Formatter interface as a replacement for PropertyEditor. The formatters are intended to provide a similar functionality but in a completely thread-safe manner and focusing on a very specific task of parsing a String in an object type and converting an object to its String representation.

Let's suppose that for our application, we would like to have a formatter that would take the ISBN number of a book in a String form and convert it to a book entity object. This way, we can define the controller request methods with a Book argument when the request URL signature only contains an ISBN number or a database ID.

主站蜘蛛池模板: 井陉县| 安阳县| 镇原县| 科尔| 贵阳市| 佛学| 临朐县| 丁青县| 磴口县| 遂溪县| 孝义市| 汝州市| 达孜县| 五峰| 互助| 深泽县| 古蔺县| 通州区| 凤阳县| 浮山县| 朝阳市| 本溪市| 辽阳市| 太保市| 巍山| 太原市| 涞水县| 彰化市| 榆社县| 大化| 富顺县| 合作市| 靖远县| 甘孜县| 仁怀市| 康平县| 屏边| 蓬莱市| 清苑县| 南城县| 墨竹工卡县|