?? filetag.java
字號:
package com.jspdev.ch14;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.io.*;
public class FileTag extends SimpleTagSupport {
private String fileName;
public void setFileName(String fileName)
{
this.fileName=fileName;
}
public void doTag() throws JspException, IOException
{
BufferedReader in=new BufferedReader(new FileReader(fileName));
String temp="";
String fileContent="";
while((temp=in.readLine())!=null)
fileContent+=temp;
in.close();
getJspContext().getOut().write( "<table border=1><tr bgcolor=9944cc><td>文件標簽</tr></td><tr bgcolor=cc44cc><td>"+fileContent+"</td></tr></table>" );
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -