Task 8) Main Menu - Server-side routing (Java) • Controllers (“controllers” package) ◦ Define a MainMenuRouteController.java class ▪ To get started you can use the existing...

I'll post the file. I have most of the code but need help with some functionality. It's part of a group project so i just have this one task.


Task 8) Main Menu - Server-side routing (Java) • Controllers (“controllers” package) ◦ Define a MainMenuRouteController.java class ▪ To get started you can use the existing ProductDetailRouteController as an example • Routes, method names, etc will be different, but it is useful as a pattern • This is used for handling web site navigation/document serving ▪ Define a route handler for requesting the view/document • GET request with “/mainMenu” route/endpoint path • Parameters ◦ Map object ▪ Use the @RequestParam[1] annotation ▪ This parameter will contain any query string[2,3] parameters passed in the URL ◦ HttpServletRequest[4] ▪ Use this to access the current session and the associated user • Functionality ◦ If there is an active user for the current session then ▪ Should add any error messages received in the query string parameters to the view ▪ Should serve up the Main Menu view/document ◦ Else ▪ Should immediately redirect[5] to the Sign In view/document with an appropriate error message [1] https://www.baeldung.com/spring-request-param [2] https://en.wikipedia.org/wiki/Query_string [3] See the heading “The GET Method” at https://www.w3schools.com/tags/ref_httpmethods.asp [4] https://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpServletRequest.html [5] https://www.baeldung.com/spring-redirect-and-forward#redirect-with-the-prefix-redirect
Mar 03, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here