zoukankan      html  css  js  c++  java
  • WebFlux中thymeleaf视图找不到的问题解决

    由于在weblux临时增加一个H5的页面,发生如下错误

    Whitelabel Error Page

    This application has no configured error view, so you are seeing this as a fallback.

    Fri Nov 27 11:18:57 CST 2020
    There was an unexpected error (type=Internal Server Error, status=500).
    Could not resolve view with name 'index'.

     最开始以为是视图路径的问题,测试没通过,考虑其它的解决方案,在网上找了一些,其实朋友说需要增加自定义模板配置,遂记录之.

    @Configuration
    @EnableWebFlux
    public class WebAppConfig implements WebFluxConfigurer {
    
        //引入spring-boot-starter-thymeleaf自动会注入该bean
        @Autowired
        private ThymeleafReactiveViewResolver thymeleafReactiveViewResolver;
    
    
        /**
         * 加入thymeleaf试图解析器,不然找不到view name
         *
         * @param registry
         */
        @Override
        public void configureViewResolvers(ViewResolverRegistry registry) {
            registry.viewResolver(thymeleafReactiveViewResolver);
        }
    
    }
    

      

  • 相关阅读:
    day35
    Audio Unit 基础
    Audio Unit 介绍
    音频PCM编码
    iOS libyuv
    FFmpeg AVPacket
    FFmpeg AVCodec
    FFmpeg编译iOS静态库
    iOS-Cocoapods更新不及时
    iOS-读取txt文件中文乱码
  • 原文地址:https://www.cnblogs.com/cqwo/p/14047003.html
Copyright © 2011-2022 走看看