@@ -118,19 +118,8 @@ protected void initBinder(WebDataBinder binder) {
118
118
binder .registerCustomEditor (String .class , "comment" , new StringTrimmerEditor (true ));
119
119
}
120
120
121
- @ ModelAttribute ("years" )
122
- public Map <Integer , Integer > getYears () {
123
- return YEARS ;
124
- }
125
-
126
- @ ModelAttribute ("countries" )
127
- public List <LinkEntityDto > getCountries (Locale userLocale ) {
128
- String lang = LocaleUtils .getLanguageOrNull (userLocale );
129
- return countryService .findAllAsLinkEntities (lang );
130
- }
131
-
132
121
@ GetMapping (Url .ADD_SERIES_PAGE )
133
- public AddSeriesForm showForm (
122
+ public void showForm (
134
123
@ Category @ RequestParam (name = "category" , required = false ) LinkEntityDto category ,
135
124
@ Country @ RequestParam (name = "country" , required = false ) LinkEntityDto country ,
136
125
Model model ,
@@ -141,6 +130,11 @@ public AddSeriesForm showForm(
141
130
List <FirstLevelCategoryDto > categories = categoryService .findFirstLevelCategories (lang );
142
131
model .addAttribute ("categories" , categories );
143
132
133
+ List <LinkEntityDto > countries = countryService .findAllAsLinkEntities (lang );
134
+ model .addAttribute ("countries" , countries );
135
+
136
+ model .addAttribute ("years" , YEARS );
137
+
144
138
AddSeriesForm addSeriesForm = new AddSeriesForm ();
145
139
addSeriesForm .setPerforated (true );
146
140
@@ -152,7 +146,7 @@ public AddSeriesForm showForm(
152
146
addSeriesForm .setCountry (country );
153
147
}
154
148
155
- return addSeriesForm ;
149
+ model . addAttribute ( "addSeriesForm" , addSeriesForm ) ;
156
150
}
157
151
158
152
@ GetMapping (Url .ADD_SERIES_WITH_CATEGORY_PAGE )
@@ -199,6 +193,11 @@ public String processInput(
199
193
List <FirstLevelCategoryDto > categories = categoryService .findFirstLevelCategories (lang );
200
194
model .addAttribute ("categories" , categories );
201
195
196
+ List <LinkEntityDto > countries = countryService .findAllAsLinkEntities (lang );
197
+ model .addAttribute ("countries" , countries );
198
+
199
+ model .addAttribute ("years" , YEARS );
200
+
202
201
// don't try to re-display file upload field
203
202
form .setImage (null );
204
203
return null ;
0 commit comments