在weblogic中在jsp页面中this.getServletContext().getRealPath("/upload")这样的写法是要报错的
在jsp页面总你甚至不能使用this.getServletContext(), 而在servlet中.getRealPath("/") 返回的是null

用下面的语句可以在F:\Oracle\Middleware\user_projects\domains\base_domain下创建uploadtemp目录
(在eclips调试环境中中,改语句会在eclips.exe同级目录下建立uploadtemp目录)

   DiskFileItemFactory factory = new DiskFileItemFactory();
   File tempDir=new File("uploadtemp");
   if(!tempDir.exists()){
    
    tempDir.mkdirs();
   }
   factory.setRepository(tempDir);
View Code

相关文章:

  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2021-12-12
  • 2021-09-16
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-20
  • 2021-09-02
  • 2021-07-24
  • 2021-05-30
  • 2021-07-13
  • 2022-12-23
相关资源
相似解决方案