0
SpringコントローラのRequestMappingをオーバーロードしようとしています。コントローラはリクエストメソッドとしてPOSTを取得しました。私はそれをオーバーロードするために別のパラメータを渡す必要があります。オーバーロードポストRequestMapping
どのようにURLを変更せずにこれを行うことができますか?
@RequestMapping(method = RequestMethod.POST, value = "/windparks/import/error")
public ModelAndView handleFileUploadError(Locale locale, @AuthenticationPrincipal SpringUser authenticatedUser, List<RegulationEvent> regList, @RequestParam("regulations") MultipartFile regulations, RedirectAttributes redirectAttributes, @PathVariable String windparkId) throws IOException, WindSpeedInterpolator.TimeSeriesMismatchException, SAXException {
ModelAndView view = new ModelAndView("uis/windparks/parkdetail");
view.addObject("failedEvents", regList);
view.addObject("windparkId", windparkId);
return view;
}
@RequestMapping(method = RequestMethod.POST, value = "/windparks/import/error")
public ModelAndView handleFileUploadError(Locale locale, @AuthenticationPrincipal SpringUser authenticatedUser, RedirectAttributes redirectAttributes, @PathVariable String windparkId) throws IOException, WindSpeedInterpolator.TimeSeriesMismatchException, SAXException {
ModelAndView view = new ModelAndView("uis/windparks/parkdetail");
view.addObject("windparkId", windparkId);
return view;
}
非常にうまく動作します、ありがとう! – Frossy