Closed
Description
Kazuki Shimizu opened SPR-13518 and commented
I hope to support the java.time.YearMonth
class in type conversion service.
For example:
@RequestMapping("/timecards")
@Controller
public class TimecardController {
@Autowired
TimecardService timecardService;
@RequestMapping(path = "{targetMonth}", method = RequestMethod.GET)
public String viewDetail(@DateTimeFormat(pattern = "yyyyMM") @PathVariable YearMonth targetMonth, Model model) {
Timecard timecard = timecardService.getTimecard(targetMonth);
model.addAttribute(timecard);
return "timecard/detail";
}
}
How do think ?
Affects: 4.2.1
Issue Links:
- NoClassDefFoundError: org/joda/time/YearMonth for joda-time < 2 [SPR-13730] #18303 NoClassDefFoundError: org/joda/time/YearMonth for joda-time < 2
- @DateTimeFormat support for YearMonth, MonthDay, Year [SPR-14839] #19405
@DateTimeFormat
support for YearMonth, MonthDay, Year - Add conversion support for java.time.Duration [SPR-13579] #18156 Add conversion support for java.time.Duration
- Add JSR 310 Period and Duration Converters [SPR-13721] #18294 Add JSR 310 Period and Duration Converters