SpringMVC interceptor modifies URL - Stack Overflow
phpcn_u1582
phpcn_u1582 2017-05-17 10:07:06
0
1
533

update 2017-4-25 10:16
Update, this will only happen when redirecting


  1. When using springmvc, inherit HandlerInterceptor and rewrite the postHandle method, add parameters to ModelAndView in the method, if the parameter is an object, it is normal, if it is a basic data type, the jump url will be modified, and the parameters will be used The get method is attached at the back.

  2. The code is as follows

        // 静态的导航栏node
        model.put("nodes", nodeService.getNodeListStatic());
        model.put("navbar", nodeService.getNodeHtmlStatic());
        modelAndView.addAllObjects(model);
  3. This is the url of the interface

    http://localhost:8080/admin/index?navbar=test&isAdmin=true
  4. Has anyone encountered this? How to solve this problem?

phpcn_u1582
phpcn_u1582

reply all(1)
洪涛

You can wrap a class object and put the required parameters into it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!