I define Spring MVC controllers for each JSP page, such as HomePageController, CategoryPageController, ProductPageController, CartPageController etc. Along with a webstore. And all these controllers call DB to bring and display menus at the top of the JSP pages. Call DB to bring each of the mentors mentioned above.
I'm using the spring 3.0 framework.
HomePageController.java
@Controller @RequestMapping (HOME_PAGE_CONTROLLER) public class HomePageController extends BasePageController {@RequestMapping (method = RequestMethod.GET) protected ModelAndView ProcessRequest (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {ModelAndView MAV = new ModelAndView (); Mav.addObject ("menu categories", masterdata service .gate all menu categories ()); Return Show Page (Maui, HOME_PAGE_URL); }}
I think in a way that this call is unnecessary, because 1) all the controllers menu 2) difficult to maintain to maintain because of changes in the business logic changes There are many controllers this call will be required
What is the best practice in this type of scenario? How can I get this call from multiple controllers? Is this a way to call a central location so that this piece of code does not cut into all the controllers?
No comments:
Post a Comment