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

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.

主站蜘蛛池模板: 田东县| 西和县| 万宁市| 通山县| 桓仁| 赫章县| 山西省| 闽侯县| 黄龙县| 盘锦市| 铜鼓县| 织金县| 盐池县| 忻州市| 南投县| 肇庆市| 酒泉市| 黑龙江省| 潜山县| 砀山县| 龙岩市| 神农架林区| 绥德县| 合阳县| 本溪市| 奉贤区| 铁力市| 平定县| 永清县| 潮安县| 新邵县| 景德镇市| 滨海县| 滦南县| 都匀市| 凤阳县| 板桥市| 武鸣县| 全南县| 蒲城县| 湘潭市|