zoukankan      html  css  js  c++  java
  • springboot常见问题

    1.spring搜不到@requestmapping

    导入包文件

    <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    

     2.这里是因为application和controller没有在一个包下,改下就好了

     3.报错

    Springboot启动时报错 If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
    

     在applicationt添加一句

    @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
    

    4.拦截器不起作用,在Application上面添加一句

    @SpringBootApplication(scanBasePackages={"com.example.demo"})
    @ComponentScan(basePackages={"com.example.demo.config"})
    

     5.找不到template的html的文件

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency> 

    右键项目 -》 找到Maven -》 选择Reimport即可,然后重启

  • 相关阅读:
    web安全
    WCF通信架构
    WCF地址
    WCFContracts(契约)
    分布式中的王者WCF
    SOAP 介绍
    诊所管理软件
    MFC 画图CDC双缓冲
    Linux 启动、关闭、重启网络服务
    C# 除法的小数点问题
  • 原文地址:https://www.cnblogs.com/hualuoshuijia/p/13712771.html
Copyright © 2011-2022 走看看