File: jsp22.jsp

package info (click to toggle)
netbeans 8.1%2Bdfsg3-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 816,472 kB
  • ctags: 847,258
  • sloc: java: 5,564,229; xml: 634,273; cpp: 25,695; ansic: 20,104; jsp: 12,621; sh: 10,354; php: 4,204; makefile: 1,456; fortran: 1,200; sql: 1,192; objc: 288; perl: 277; haskell: 120; yacc: 30; awk: 17; lex: 11; asm: 4
file content (163 lines) | stat: -rw-r--r-- 4,614 bytes parent folder | download | duplicates (600)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<%@page contentType="text/html;charset=UTF-8"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.Date"%>

<html>
<head>
  <title>JSP Page</title>
</head>

<body>

<h1>Testing JSP</h1>

<i>This is JSP which contains as many as possible JSP structures.</i><br>

<i>Now we are testing HTML comment which should appear in page.</i><br>
<!-- one line HTML comment -->

<i>And now HTML comment split to more lines.</i><br>
<!-- this is HTML comment
     split to 
     more lines -->
     
<i>Now we are testing JSP comment which should not appear in page.</i><br>    
<%-- one line JSP comment --%>

<i>And now JSP comment splt to more lines.</i><br>
<%-- this is JSP comment
     split to 
     more lines --%>

<i>Test of variable declaration.</i><br>     
<%! int i = 1; %>

<i>Test of multiple variable declaration.</i><br>     
<%! int a = 0;
    int b;
    int c = 1;
%>

<i>Test of one line scriptlet.</i><br>     
<%  out.println("This is output from scriptlet<br>"); %>

<i>Test of mutliple line scriptlet.</i><br>
<%  out.println("This is output from another scriptlet<br>"); 
    Date date = new Date();
    out.println("Today is "+date.toString()+"<br>");
    a = i + i;
    b = 2; c = b * b;
    out.println("1 + 1 = "+a+"<br>");
    out.println("2 * 2 = "+c+"<br>");
%>

<i>Test of expression.</i><br>
Free memory: <%=Runtime.getRuntime().freeMemory()%><br>

Used memory: <%=Runtime.getRuntime().totalMemory() - 
                Runtime.getRuntime().freeMemory()%><br>
     
<i>Test of beans.</i><br>     
<jsp:useBean id="bean" scope="session" class="test.TestBean" />
<jsp:setProperty name="bean" property="intProperty" value="100"/>
intProperty = <jsp:getProperty name="bean"  property="intProperty"/><br>

1 + 2 = ${1 + 2} <br>
intProperty = ${bean["intProperty"]}<br>

<h2>And once again</h2>

<i>This is JSP which contains as many as possible JSP structures.</i><br>

<i>Now we are testing HTML comment which should appear in page.</i><br>
<!-- one line HTML comment -->

<i>And now HTML comment split to more lines.</i><br>
<!-- this is HTML comment
     split to 
     more lines -->
     
<i>Now we are testing JSP comment which should not appear in page.</i><br>    
<%-- one line JSP comment --%>

<i>And now JSP comment splt to more lines.</i><br>
<%-- this is JSP comment
     split to 
     more lines --%>

<i>Test of one line scriptlet.</i><br>     
<%  out.println("This is output from scriptlet<br>"); %>

<i>Test of mutliple line scriptlet.</i><br>
<%  out.println("This is output from another scriptlet<br>"); 
    date = new Date();
    out.println("Today is "+date.toString()+"<br>");
    i = 1;
    a = i + i;
    b = 2; c = b * b;
    out.println("1 + 1 = "+a+"<br>");
    out.println("2 * 2 = "+c+"<br>");
%>

<i>Test of expression.</i><br>
Free memory: <%=Runtime.getRuntime().freeMemory()%><br>

Used memory: <%=Runtime.getRuntime().totalMemory() - 
                Runtime.getRuntime().freeMemory()%><br>
     
<i>Test of beans.</i><br>     
<jsp:setProperty name="bean" property="intProperty" value="200"/>
intProperty = <jsp:getProperty name="bean"  property="intProperty"/><br>

1 + 2 = ${1 + 2} <br>
intProperty = ${bean["intProperty"]}<br>

<h2>And for the last time</h2>

<i>This is JSP which contains as many as possible JSP structures.</i><br>

<i>Now we are testing HTML comment which should appear in page.</i><br>
<!-- one line HTML comment -->

<i>And now HTML comment split to more lines.</i><br>
<!-- this is HTML comment
     split to 
     more lines -->
     
<i>Now we are testing JSP comment which should not appear in page.</i><br>    
<%-- one line JSP comment --%>

<i>And now JSP comment splt to more lines.</i><br>
<%-- this is JSP comment
     split to 
     more lines --%>

<i>Test of one line scriptlet.</i><br>     
<%  out.println("This is output from scriptlet<br>"); %>

<i>Test of mutliple line scriptlet.</i><br>
<%  out.println("This is output from another scriptlet<br>"); 
    date = new Date();
    out.println("Today is "+date.toString()+"<br>");
    i = 1;
    a = i + i;
    b = 2; c = b * b;
    out.println("1 + 1 = "+a+"<br>");
    out.println("2 * 2 = "+c+"<br>");
%>

<i>Test of expression.</i><br>
Free memory: <%=Runtime.getRuntime().freeMemory()%><br>

Used memory: <%=Runtime.getRuntime().totalMemory() - 
                Runtime.getRuntime().freeMemory()%><br>
     
<i>Test of beans.</i><br>     
<jsp:setProperty name="bean" property="intProperty" value="200"/>
intProperty = <jsp:getProperty name="bean"  property="intProperty"/><br>

1 + 2 = ${1 + 2} <br>
intProperty = ${bean["intProperty"]}<br>

</body>
</html>