2828 */
2929@ Slf4j
3030@ Controller
31- @ RequestMapping (value = "/project" )
31+ @ RequestMapping (path = "/project" )
3232public class ProjectController extends AbstractController {
3333
3434 private final TaskService taskService ;
@@ -44,7 +44,7 @@ public ProjectController(TaskService taskService, TaskMoveService taskMoveServic
4444 this .projectService = projectService ;
4545 }
4646
47- @ RequestMapping (value = "/root" , method = RequestMethod .GET )
47+ @ RequestMapping (path = "/root" , method = RequestMethod .GET )
4848 public final String showRootProject (
4949 @ PageableDefault (sort = "orderIdProject" ) Pageable pageable ,
5050 @ RequestParam (required = false ) String message ,
@@ -66,7 +66,7 @@ public final String showRootProject(
6666 return "project/root" ;
6767 }
6868
69- @ RequestMapping (value = "/{projectId}" , method = RequestMethod .GET )
69+ @ RequestMapping (path = "/{projectId}" , method = RequestMethod .GET )
7070 public final String showProject (
7171 @ PathVariable long projectId ,
7272 @ PageableDefault (sort = "orderIdProject" ) Pageable pageable ,
@@ -100,26 +100,26 @@ public final String showProject(
100100 return "project/show" ;
101101 }
102102
103- @ RequestMapping (value = "/add/new/project" , method = RequestMethod .GET )
103+ @ RequestMapping (path = "/add/new/project" , method = RequestMethod .GET )
104104 public final String addNewTopLevelProjectForm (
105105 @ ModelAttribute ("userSession" ) UserSessionBean userSession ,
106106 Locale locale , Model model
107107 ){
108- return addNewProjectGet (rootProjectId , userSession ,locale , model );
108+ return addNewProject (rootProjectId , userSession , locale , model );
109109 }
110110
111111
112- @ RequestMapping (value = "/add/new/project" , method = RequestMethod .POST )
112+ @ RequestMapping (path = "/add/new/project" , method = RequestMethod .POST )
113113 public final String addNewTopLevelProjectSave (
114114 @ Valid Project project ,
115115 @ ModelAttribute ("userSession" ) UserSessionBean userSession ,
116116 BindingResult result ,
117117 Locale locale , Model model
118118 ){
119- return addNewProjectPost ( rootProjectId , userSession , project , result , locale , model );
119+ return addNewProjectPersist ( rootProjectId , userSession , project , result , locale , model );
120120 }
121121
122- @ RequestMapping (value = "/{thisProjectId}/move/to/{targetProjectId}" , method = RequestMethod .GET )
122+ @ RequestMapping (path = "/{thisProjectId}/move/to/{targetProjectId}" , method = RequestMethod .GET )
123123 public final String moveProject (
124124 @ PathVariable ("thisProjectId" ) Project thisProject ,
125125 @ PathVariable long targetProjectId ,
@@ -134,7 +134,7 @@ public final String moveProject(
134134 return "redirect:/project/" + thisProject .getId ();
135135 }
136136
137- @ RequestMapping (value = "/{projectId}/edit" , method = RequestMethod .GET )
137+ @ RequestMapping (path = "/{projectId}/edit" , method = RequestMethod .GET )
138138 public final String editProjectGet (
139139 @ PathVariable ("projectId" ) Project thisProject ,
140140 @ ModelAttribute ("userSession" ) UserSessionBean userSession ,
@@ -153,7 +153,7 @@ public final String editProjectGet(
153153 return "project/edit" ;
154154 }
155155
156- @ RequestMapping (value = "/{projectId}/edit" , method = RequestMethod .POST )
156+ @ RequestMapping (path = "/{projectId}/edit" , method = RequestMethod .POST )
157157 public final String editProjectPost (
158158 @ PathVariable long projectId ,
159159 @ Valid Project project ,
@@ -190,7 +190,7 @@ public final String editProjectPost(
190190 }
191191 }
192192
193- @ RequestMapping (value = "/{projectId}/delete" , method = RequestMethod .GET )
193+ @ RequestMapping (path = "/{projectId}/delete" , method = RequestMethod .GET )
194194 public final String deleteProject (
195195 @ PathVariable ("projectId" ) Project project ,
196196 @ PageableDefault (sort = "title" ) Pageable request ,
@@ -239,11 +239,11 @@ public final String deleteProject(
239239 }
240240
241241
242- @ RequestMapping ( value = "/{projectId}/add/new/project" , method = RequestMethod . GET )
243- public final String addNewProjectGet (
244- @ PathVariable long projectId ,
245- @ ModelAttribute ( "userSession" ) UserSessionBean userSession ,
246- Locale locale , Model model
242+ private final String addNewProject (
243+ long projectId ,
244+ UserSessionBean userSession ,
245+ Locale locale ,
246+ Model model
247247 ) {
248248 Context context = super .getContext (userSession );
249249 UserAccount userAccount = context .getUserAccount ();
@@ -272,14 +272,13 @@ public final String addNewProjectGet(
272272 return "project/add" ;
273273 }
274274
275- @ RequestMapping (value = "/{projectId}/add/new/project" ,
276- method = RequestMethod .POST )
277- public final String addNewProjectPost (
278- @ PathVariable long projectId ,
279- @ ModelAttribute ("userSession" ) UserSessionBean userSession ,
280- @ Valid Project project ,
281- BindingResult result ,
282- Locale locale , Model model ) {
275+ private String addNewProjectPersist (
276+ @ PathVariable long projectId ,
277+ @ ModelAttribute ("userSession" ) UserSessionBean userSession ,
278+ @ Valid Project project ,
279+ BindingResult result ,
280+ Locale locale , Model model
281+ ){
283282 Context context = super .getContext (userSession );
284283 UserAccount userAccount = context .getUserAccount ();
285284 userSession .setLastProjectId (projectId );
@@ -319,7 +318,27 @@ public final String addNewProjectPost(
319318 }
320319 }
321320
322- @ RequestMapping (value = "/task/{sourceTaskId}/changeorderto/{destinationTaskId}" , method = RequestMethod .GET )
321+ @ RequestMapping (path = "/{projectId}/add/new/project" , method = RequestMethod .GET )
322+ public final String addNewProjectGet (
323+ @ PathVariable long projectId ,
324+ @ ModelAttribute ("userSession" ) UserSessionBean userSession ,
325+ Locale locale , Model model
326+ ) {
327+ return addNewProject (projectId , userSession , locale , model );
328+ }
329+
330+ @ RequestMapping (path = "/{projectId}/add/new/project" ,
331+ method = RequestMethod .POST )
332+ public final String addNewProjectPost (
333+ @ PathVariable long projectId ,
334+ @ ModelAttribute ("userSession" ) UserSessionBean userSession ,
335+ @ Valid Project project ,
336+ BindingResult result ,
337+ Locale locale , Model model ) {
338+ return addNewProjectPersist ( projectId , userSession , project , result , locale , model );
339+ }
340+
341+ @ RequestMapping (path = "/task/{sourceTaskId}/changeorderto/{destinationTaskId}" , method = RequestMethod .GET )
323342 public String changeTaskOrderIdWithinAProject (
324343 @ PathVariable ("sourceTaskId" ) Task sourceTask ,
325344 @ PathVariable ("destinationTaskId" ) Task destinationTask ,
0 commit comments