listfilename.jsp

来自「这套JSP学习资料」· JSP 代码 · 共 33 行

JSP
33
字号
<HTML>
<%@page contentType="text/html;charset=GB2312"%>
<%@page import="ReadFile"%>

<BODY bgcolor=cyan><Font size=3>

<jsp:useBean id="file" class="ReadFile" scope="session">
</jsp:useBean>
<jsp:setProperty name="file" property="filePath" param="filePath"/>
<P>该目录
<jsp:getProperty name="file" property="filePath"/>
有如下文件:<BR>

<%	String name[]=file.listFile();
	for(int i=0;i<name.length;i++)
		out.print("<BR>"+name[i]);
%>

<FORM action="readfile.jsp" method=post>
	<P>输入文件的名字:
	<INPUT type="text" value="f" name="fileName">
	<INPUT type="submit" value="提交" >
</FORM>

<BR>
<FORM action="filepathselect.jsp" method=post name=form>
	<INPUT type="submit" value="重新选择目录" >
</FORM>

</FONT>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?