The text before

Finally, I integrated the login interface with the management system. I have a complete Demo, which can be regarded as entering the SSM door, but it is still the most basic version. New functions will be added continuously in the future

The body of the

v1.0

Will login interface and management system integration together, make a small Demo, there is nothing to say about the process of merging, say what needs to be modified

1. spring-mvc.xml

The configuration of the two projects is not quite the same, so we use the configuration file in the login screen because the interceptor is configured

2. Controller

ProductController: @requestMapping (“product”)

Because the JSPS are classified and stored in two folders, you need to add user/ or product/ to locate the view when defining it in the Controller

Add a method to ProductController that, after logging in, acts as an entry point to the admin system:

    @RequestMapping("/getFrame")
    public ModelAndView getFrame() {return new ModelAndView("product/frame");
    }
Copy the code
3. JSP

Because ProductController uses narrow request, partial URL overlap will occur when the page jumps. Currently, we have not thought of a good way, so we can only use absolute URL to replace it

So the product of the JSP, in link with ${pageContext. Request. ContextPath} said use absolute paths, otherwise it will be 404

4. To summarize

It’s easy to integrate the two, just merge them, modify them a little bit, and then add some Spring features, like AOP, transaction management, etc.