xuxueli / xxl-job

A distributed task scheduling framework.(分布式任务调度平台XXL-JOB)
http://www.xuxueli.com/xxl-job/
GNU General Public License v3.0
27.72k stars 10.95k forks source link

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

Open myheavenha opened 1 year ago

myheavenha commented 1 year ago

image

tinnkm commented 12 months ago

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);
        }
    }
zuihou commented 10 months ago

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);
        }
    }

有用。👍🏻