代碼如下:
<%@ page contentType="text/html; charset=big5" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.io.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>???文?</title>
<style type="text/css">
<!--
body {
background-color: #CCCCCC;
}
-->
</style></head><body>
<%!
  class FileJSP implements FilenameFilter
  {
  String str=null;
  FileJSP(String s)
  {str="."+s;
  }
  public boolean accept(File dir,String name)
  { return name.endsWith(str);
  }
  }
%>
<P>下面列出了服務器上的一些JSP文件</P>
<%
  File dir=new File("C:\\Tomcat 5.5\\webapps\\test");
  FileJSP file_jsp=new FileJSP("jsp");
  String file_name[]=dir.list(file_jsp);
  for(int i=0;i<file_name.length;i++)
  {out.println("<br>"+file_name[i]);
  }
%>
</body>
</html>這個一個過濾后綴后JSP的文件的代碼,這行代碼我看不懂
  public boolean accept(File dir,String name)
  { return name.endsWith(str);
  }這是一個行數,是接口fileNameFilter的一個行數。accept(File dir,String name)括號里面不是要填寫參數的嗎?return name.endsWith(str) 這個name哪里來的呢