?? ls.jsp
字號:
<%@ page import="java.io.File" errorPage="err.jsp" %>
<%@ taglib uri="gnat" prefix="gnat" %>
<%--
Use the Servlet 2.2+ temporary working directory to demo some file stuff.
Makes it easier because the user doesn't have to configure anything and I
don't have to worry about file system and user permissions for the demo.
See section 3.7 of Servlet 2.3 spec for description of this attribute.
--%>
<%! File tempdir = null; %>
<% tempdir = (File)application.getAttribute("javax.servlet.context.tempdir"); %>
<html>
<head>
<title>Gnat JSP Taglib</title>
<link type="text/css" href="examples.css" rel="stylesheet">
</head>
<body>
<h1>Gnat Taglib: ls</h1>
<p>Gets a directory listing as a String array named "list."
</p>
<p>example 1 - ls</p>
<br /><ul>
<br /><gnat:ls dir="<%= tempdir.toString() %>" id="list">
<br /> <li><i><font color="blue"><jsp:getProperty name="list" property="item" /></font></i></li>
<br /></gnat:ls>
<br /></ul>
<%-- Be careful with this tag -- you can use it to list the contents of any directory
on your filesytem unless you take security measures with a Java policy file. --%>
<h3>looping through a directory and formatting the file names in HTML.</h3>
<p>File listing for <%= tempdir %></p>
<ul>
<gnat:ls dir="<%= tempdir.toString() %>" id="list">
<li><i><font color="blue"><jsp:getProperty name="list" property="item" /></font></i></li>
</gnat:ls>
</ul>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -