From 4561e388073d8885e1ffc5988099a9d7a494a58f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Cocula?= Date: Sun, 11 Dec 2016 19:11:29 +0100 Subject: [PATCH] Corrections on GeneralSettingsController. --- .../player/controller/GeneralSettingsController.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libresonic-main/src/main/java/org/libresonic/player/controller/GeneralSettingsController.java b/libresonic-main/src/main/java/org/libresonic/player/controller/GeneralSettingsController.java index daa38959..6ee010c1 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/controller/GeneralSettingsController.java +++ b/libresonic-main/src/main/java/org/libresonic/player/controller/GeneralSettingsController.java @@ -48,7 +48,12 @@ public class GeneralSettingsController { private SettingsService settingsService; @RequestMapping(method = RequestMethod.GET) - protected String formBackingObject(Model model) throws Exception { + protected String displayForm() throws Exception { + return "generalSettings"; + } + + @ModelAttribute + protected void formBackingObject(Model model) throws Exception { GeneralSettingsCommand command = new GeneralSettingsCommand(); command.setCoverArtFileTypes(settingsService.getCoverArtFileTypes()); command.setIgnoredArticles(settingsService.getIgnoredArticles()); @@ -87,11 +92,10 @@ public class GeneralSettingsController { command.setLocales(localeStrings); model.addAttribute("command",command); - return "generalSettings"; } @RequestMapping(method = RequestMethod.POST) - protected String doSubmitAction(@ModelAttribute GeneralSettingsCommand command, Model model) throws Exception { + protected String doSubmitAction(@ModelAttribute("command") GeneralSettingsCommand command, Model model) throws Exception { int themeIndex = Integer.parseInt(command.getThemeIndex()); Theme theme = settingsService.getAvailableThemes()[themeIndex];