一聚教程网:一个值得你收藏的教程网站

热门教程

jsp中的import函数的使用方法

时间:2022-06-29 02:39:33 编辑:袖梨 来源:一聚教程网

jsp教程中的import函数的使用方法

<%@ page import="java.io.*" %>

   
        Index of Files
   

   
       

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)
            <%
                    }
                }
            %>
           

   

热门栏目