jsp中的import函数的使用方法

作者:袖梨 2022-06-29

       

Index of Files


        Click a file to open/download it...
        <%
            String file = application.getRealPath("/");

            File file1 = new File(file);
            String [] fileNames = file1.list();
            File [] fileObjects= file1.listFiles();
        %>
       


  •         <%

  •             for (int i = 0; i < fileObjects.length; i++) {

  •                 if(!fileObjects[i].isDirectory()){

  •         %>

  •        

  •           <%= fileNames[i] %>
                  
              (<%= Long.toString(fileObjects[i].length()) %> bytes long)
            <%
                    }
                }
            %>
           

   

相关文章

精彩推荐