?? simpletagdemo.java
字號:
/**
*
*/
package customtag;
import javax.servlet.jsp.tagext.*;
import java.io.*;
import java.util.*;
import javax.servlet.jsp.*;
/**
* @author Administrator
*
*/
public class SimpleTagDemo extends SimpleTagSupport {
private int num;
public void setNum(int num) {
this.num = num;
}
/**
* Called by the container to invoke this tag.
*
* @throws JspException If an error occurred while processing this tag.
* @throws IOException If there was an error writing to the output
* stream.
* @todo Implement this javax.servlet.jsp.tagext.SimpleTag method
*/
public void doTag() throws JspException, IOException {
JspWriter out = this.getJspContext().getOut();
out.println("<h1>演示" + num + "次輸出標(biāo)簽體的內(nèi)容</h1>");
for (int i = 0; i < num; i++) {
getJspContext().setAttribute("count", String.valueOf(i + 1));
getJspBody().invoke(null);
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -