[jsp中的import]jsp中的import函数的使用方法

更新时间:2017-02-21    来源:php函数    手机版     字体:

【www.bbyears.com--php函数】

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

本文来源:http://www.bbyears.com/jiaocheng/30669.html