-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprintTableTag.java
More file actions
42 lines (32 loc) · 964 Bytes
/
printTableTag.java
File metadata and controls
42 lines (32 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package tags;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
/**
*
* @author Remote
*/
public class printTableTag extends TagSupport {
public void setNumber(int number) {
this.number = number;
}
public int number;
//setter
@Override
public int doStartTag() throws JspException {
try{
JspWriter out=pageContext.getOut();
//print table:
out.print("<br>");
for(int i=1;i<=10;i++){
out.println(i*number +"<br>");
}}catch(Exception e){
e.printStackTrace();
}
return SKIP_BODY;
}
}