主要要再pom文件里面添加依赖:

 <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>4.0.1</version>
      <scope>provided</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/javax.servlet.jsp/jsp-api -->
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.2</version>
      <scope>provided</scope>
    </dependency>

上面的这两个依赖是必须的,要不然写什么out page都是不行的

 

如果上传文件还需要添加下面的依赖:

    <!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
      <version>1.4</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.4</version>
    </dependency>

 

相关文章:

  • 2021-09-08
  • 2022-12-23
  • 2021-05-18
  • 2021-04-07
  • 2021-08-22
  • 2021-09-03
  • 2021-07-19
  • 2021-09-10
猜你喜欢
  • 2021-09-30
  • 2021-07-09
  • 2021-09-18
  • 2021-12-11
  • 2021-12-26
  • 2021-05-26
相关资源
相似解决方案