- Spring Boot 2.0 Cookbook(Second Edition)
- Alex Antonov
- 127字
- 2021-06-24 19:24:42
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.
推薦閱讀
- Test-Driven Development with Mockito
- 數據要素五論:信息、權屬、價值、安全、交易
- 深入淺出MySQL:數據庫開發、優化與管理維護(第2版)
- 達夢數據庫性能優化
- WS-BPEL 2.0 Beginner's Guide
- MATLAB Graphics and Data Visualization Cookbook
- 深入淺出 Hyperscan:高性能正則表達式算法原理與設計
- IPython Interactive Computing and Visualization Cookbook(Second Edition)
- Python數據分析與數據化運營
- MySQL技術內幕:InnoDB存儲引擎
- 數據挖掘與機器學習-WEKA應用技術與實踐(第二版)
- 大數據計算系統原理、技術與應用
- 數據迷霧:洞察數據的價值與內涵
- Machine Learning for Mobile
- Tableau數據可視化實戰