xxl-job spring6.0.7,springboot3.0.5 报错I18nUtil [in template "common/common.macro.ftl" at line 32, column 25]

nukf8bse  于 2个月前  发布在  Spring
关注(0)|答案(2)|浏览(136)

puruo6ea

puruo6ea1#

spring6移除了对freemaker的jsp支持,所以导致了内置的Request对象用不了,可以在PermissionInterceptor下添加以下代码

@Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
        if (modelAndView != null) {
            Map<String, Object> attributes = new HashMap<>();
            Enumeration<String> enumeration = request.getAttributeNames();
            while (enumeration.hasMoreElements()) {
                String key = enumeration.nextElement();
                attributes.put(key, request.getAttribute(key));
            }
            modelAndView.addObject("Request", attributes);
        }
    }
qpgpyjmq

qpgpyjmq2#

spring6移除了对freemaker的jsp支持,所以导致了内置的Request对象用不了,可以在PermissionInterceptor下添加以下代码

@Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
        if (modelAndView != null) {
            Map<String, Object> attributes = new HashMap<>();
            Enumeration<String> enumeration = request.getAttributeNames();
            while (enumeration.hasMoreElements()) {
                String key = enumeration.nextElement();
                attributes.put(key, request.getAttribute(key));
            }
            modelAndView.addObject("Request", attributes);
        }
    }

有用。👍🏻

相关问题