Changeset View
Changeset View
Standalone View
Standalone View
autotests/html/highlight.jsp.html
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> | ||
---|---|---|---|---|---|
2 | <html><head> | 2 | <html><head> | ||
3 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | 3 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | ||
4 | <title>highlight.jsp</title> | 4 | <title>highlight.jsp</title> | ||
5 | <meta name="generator" content="KF5::SyntaxHighlighting (JSP)"/> | 5 | <meta name="generator" content="KF5::SyntaxHighlighting (JSP)"/> | ||
6 | </head><body style="color:#1f1c1b"><pre> | 6 | </head><body style="color:#1f1c1b"><pre> | ||
7 | <span style="color:#898887;"><%--</span> | 7 | <span style="color:#898887;"><%--</span> | ||
8 | <span style="color:#898887;"> This page won't actually work, as it is simply designed to display jsp syntax highlighting.</span> | 8 | <span style="color:#898887;"> This page won't actually work, as it is simply designed to display jsp syntax highlighting.</span> | ||
9 | <span style="color:#898887;">--%></span> | 9 | <span style="color:#898887;">--%></span> | ||
10 | <span style="color:#0000ff;font-weight:bold;font-style:italic;"><%@ page</span><span style="color:#006e28;"> info</span>=<span style="color:#bf0303;">"A Page to Test Kate Jsp Syntax Highlighting"</span><span style="color:#006e28;"> language</span>=<span style="color:#bf0303;">"java"</span><span style="color:#006e28;"> errorPage</span>=<span style="color:#bf0303;">"/test-error-page.jsp"</span><span style="color:#0000ff;font-weight:bold;font-style:italic;">%></span> | 10 | <span style="color:#644a9b;font-weight:bold;font-style:italic;"><%@ page</span><span style="color:#006e28;"> info</span>=<span style="color:#bf0303;">"A Page to Test Kate Jsp Syntax Highlighting"</span><span style="color:#006e28;"> language</span>=<span style="color:#bf0303;">"java"</span><span style="color:#006e28;"> errorPage</span>=<span style="color:#bf0303;">"/test-error-page.jsp"</span><span style="color:#644a9b;font-weight:bold;font-style:italic;">%></span> | ||
11 | <span style="color:#0000ff;font-weight:bold;font-style:italic;"><%@ include</span><span style="color:#006e28;"> file</span>=<span style="color:#bf0303;">"/include/myglobalvars.jsp"</span><span style="color:#0000ff;font-weight:bold;font-style:italic;">%></span> --%> | 11 | <span style="color:#644a9b;font-weight:bold;font-style:italic;"><%@ include</span><span style="color:#006e28;"> file</span>=<span style="color:#bf0303;">"/include/myglobalvars.jsp"</span><span style="color:#644a9b;font-weight:bold;font-style:italic;">%></span> --%> | ||
12 | <span style="color:#0000ff;font-weight:bold;font-style:italic;"><%@ page</span><span style="color:#006e28;"> import</span>=<span style="color:#bf0303;">"java.util.*,</span> | 12 | <span style="color:#644a9b;font-weight:bold;font-style:italic;"><%@ page</span><span style="color:#006e28;"> import</span>=<span style="color:#bf0303;">"java.util.*,</span> | ||
13 | <span style="color:#bf0303;"> java.io.*,</span> | 13 | <span style="color:#bf0303;"> java.io.*,</span> | ||
14 | <span style="color:#bf0303;"> java.math.*"</span><span style="color:#006e28;"> </span><span style="color:#0000ff;font-weight:bold;font-style:italic;">%></span> | 14 | <span style="color:#bf0303;"> java.math.*"</span><span style="color:#006e28;"> </span><span style="color:#644a9b;font-weight:bold;font-style:italic;">%></span> | ||
15 | <span style="color:#0000ff;font-weight:bold;font-style:italic;"><%@ taglib</span><span style="color:#006e28;"> uri</span>=<span style="color:#bf0303;">"/WEB-INF/lib/si_taglib.tld"</span><span style="color:#006e28;"> prefix</span>=<span style="color:#bf0303;">"si"</span><span style="color:#0000ff;font-weight:bold;font-style:italic;">%></span> | 15 | <span style="color:#644a9b;font-weight:bold;font-style:italic;"><%@ taglib</span><span style="color:#006e28;"> uri</span>=<span style="color:#bf0303;">"/WEB-INF/lib/si_taglib.tld"</span><span style="color:#006e28;"> prefix</span>=<span style="color:#bf0303;">"si"</span><span style="color:#644a9b;font-weight:bold;font-style:italic;">%></span> | ||
16 | <span style="color:#0000ff;font-weight:bold;font-style:italic;"><jsp:useBean</span><span style="color:#006e28;"> id</span>=<span style="color:#bf0303;">"aPageBean"</span><span style="color:#006e28;"> scope</span>=<span style="color:#bf0303;">"page"</span><span style="color:#006e28;"> class</span>=<span style="color:#bf0303;">"my.package.MyPageBean"</span><span style="color:#0000ff;font-weight:bold;font-style:italic;">/></span> | 16 | <span style="color:#644a9b;font-weight:bold;font-style:italic;"><jsp:useBean</span><span style="color:#006e28;"> id</span>=<span style="color:#bf0303;">"aPageBean"</span><span style="color:#006e28;"> scope</span>=<span style="color:#bf0303;">"page"</span><span style="color:#006e28;"> class</span>=<span style="color:#bf0303;">"my.package.MyPageBean"</span><span style="color:#644a9b;font-weight:bold;font-style:italic;">/></span> | ||
17 | <span style="color:#0000ff;font-weight:bold;font-style:italic;"><jsp:useBean</span><span style="color:#006e28;"> id</span>=<span style="color:#bf0303;">"aRequestBean"</span><span style="color:#006e28;"> scope</span>=<span style="color:#bf0303;">"request"</span><span style="color:#006e28;"> class</span>=<span style="color:#bf0303;">"my.package.MyRequestBean"</span><span style="color:#0000ff;font-weight:bold;font-style:italic;">/></span> | 17 | <span style="color:#644a9b;font-weight:bold;font-style:italic;"><jsp:useBean</span><span style="color:#006e28;"> id</span>=<span style="color:#bf0303;">"aRequestBean"</span><span style="color:#006e28;"> scope</span>=<span style="color:#bf0303;">"request"</span><span style="color:#006e28;"> class</span>=<span style="color:#bf0303;">"my.package.MyRequestBean"</span><span style="color:#644a9b;font-weight:bold;font-style:italic;">/></span> | ||
18 | <span style="color:#000000;font-weight:bold;"><%</span> | 18 | <span style="color:#006e28;font-weight:bold;"><%</span> | ||
19 | <span style="color:#898887;">// We can decipher our expected parameters here.</span> | 19 | <span style="color:#898887;">// We can decipher our expected parameters here.</span> | ||
20 | <span style="color:#0095ff;font-weight:bold;">String</span> parm1 = noNull(request.getParameter(PARAMETER_1)).trim(); | 20 | <span style="color:#644a9b;font-weight:bold;">String</span> parm1 = <span style="color:#644a9b;">noNull</span>(request.<span style="color:#644a9b;">getParameter</span>(PARAMETER_1)).<span style="color:#644a9b;">trim</span>(); | ||
21 | <span style="color:#0095ff;font-weight:bold;">String</span> parm2 = noNull(request.getParameter(PARAMETER_2)).trim(); | 21 | <span style="color:#644a9b;font-weight:bold;">String</span> parm2 = <span style="color:#644a9b;">noNull</span>(request.<span style="color:#644a9b;">getParameter</span>(PARAMETER_2)).<span style="color:#644a9b;">trim</span>(); | ||
22 | <span style="color:#0095ff;font-weight:bold;">String</span> parm3 = noNull(request.getParameter(PARAMETER_3)).trim(); | 22 | <span style="color:#644a9b;font-weight:bold;">String</span> parm3 = <span style="color:#644a9b;">noNull</span>(request.<span style="color:#644a9b;">getParameter</span>(PARAMETER_3)).<span style="color:#644a9b;">trim</span>(); | ||
23 | <span style="color:#0095ff;font-weight:bold;">String</span> parm4 = noNull(request.getParameter(PARAMETER_4)).trim(); | 23 | <span style="color:#644a9b;font-weight:bold;">String</span> parm4 = <span style="color:#644a9b;">noNull</span>(request.<span style="color:#644a9b;">getParameter</span>(PARAMETER_4)).<span style="color:#644a9b;">trim</span>(); | ||
24 | <span style="color:#0095ff;font-weight:bold;">String</span> parm5 = noNull(request.getParameter(PARAMETER_5)).trim(); | 24 | <span style="color:#644a9b;font-weight:bold;">String</span> parm5 = <span style="color:#644a9b;">noNull</span>(request.<span style="color:#644a9b;">getParameter</span>(PARAMETER_5)).<span style="color:#644a9b;">trim</span>(); | ||
25 | 25 | | |||
26 | <span style="color:#898887;">// A sample collection of Integers to display some code folding.</span> | 26 | <span style="color:#898887;">// A sample collection of Integers to display some code folding.</span> | ||
27 | <span style="color:#0095ff;font-weight:bold;">List</span> intList = getIntList(<span style="color:#b08000;">10</span>); | 27 | <span style="color:#644a9b;font-weight:bold;">List</span> intList = <span style="color:#644a9b;">getIntList</span>(<span style="color:#b08000;">10</span>); | ||
28 | 28 | | |||
29 | 29 | | |||
30 | <span style="color:#000000;font-weight:bold;">%></span> | 30 | <span style="color:#006e28;font-weight:bold;">%></span> | ||
31 | <html> | 31 | <html> | ||
32 | <title>A Sample Jsp</title> | 32 | <title>A Sample Jsp</title> | ||
33 | <head> | 33 | <head> | ||
34 | <script<span style="color:#006e28;"> language</span>=<span style="color:#0057ae;">"javascript"</span>><span style="color:#898887;"><!--</span> | 34 | <script language=<span style="color:#0057ae;">"javascript"</span>><!-- | ||
35 | <span style="color:#898887;"> function doAlert1() {</span> | 35 | <span style="font-weight:bold;">function</span> <span style="color:#0057ae;">doAlert1</span>() { | ||
36 | <span style="color:#898887;"> alert("This is the first javascript example.");</span> | 36 | <span style="color:#0057ae;">alert</span>(<span style="color:#bf0303;">"This is the first javascript example."</span>); | ||
37 | <span style="color:#898887;"> }</span> | 37 | } | ||
38 | 38 | | |||
39 | <span style="color:#898887;"> function doAlert2() {</span> | 39 | <span style="font-weight:bold;">function</span> <span style="color:#0057ae;">doAlert2</span>() { | ||
40 | <span style="color:#898887;"> alert("This is the second javascript example.");</span> | 40 | <span style="color:#0057ae;">alert</span>(<span style="color:#bf0303;">"This is the second javascript example."</span>); | ||
41 | <span style="color:#898887;"> }</span> | 41 | } | ||
42 | <span style="color:#898887;"> //--></span></script> | 42 | <span style="color:#898887;">//--></span></script> | ||
43 | <style type=<span style="color:#0057ae;">"text/css"</span>> | ||||
44 | body{ <span style="font-weight:bold;">color</span>: <span style="color:#aa5500;">yellow</span>; } | ||||
45 | </style> | ||||
43 | </head> | 46 | </head> | ||
44 | <body> | 47 | <body> | ||
45 | <span style="color:#898887;"><%-- The top label table. --%></span> | 48 | <span style="color:#898887;"><%-- The top label table. --%></span> | ||
46 | <table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">"400"</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">"0"</span>> | 49 | <table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">"400"</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">"0"</span>> | ||
47 | <tr> | 50 | <tr> | ||
48 | <td><font<span style="color:#006e28;"> size</span>=<span style="color:#0057ae;">"3"</span>><b>The following parameters were detected:</b></font></td> | 51 | <td><font<span style="color:#006e28;"> size</span>=<span style="color:#0057ae;">"3"</span>><b>The following parameters were detected:</b></font></td> | ||
49 | </tr> | 52 | </tr> | ||
50 | </table> | 53 | </table> | ||
51 | 54 | | |||
52 | <span style="color:#898887;"><%-- Display the parameters which might have been passed in. --%></span> | 55 | <span style="color:#898887;"><%-- Display the parameters which might have been passed in. --%></span> | ||
53 | <table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">"400"</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">"0"</span>> | 56 | <table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">"400"</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">"0"</span>> | ||
54 | <span style="color:#898887;"><%-- Label; Actual Parameter String; Value Detected --%></span> | 57 | <span style="color:#898887;"><%-- Label; Actual Parameter String; Value Detected --%></span> | ||
55 | <tr> | 58 | <tr> | ||
56 | <td><b>PARAMETER_1</b></td> | 59 | <td><b>PARAMETER_1</b></td> | ||
57 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"center"</span>><span style="color:#000000;font-weight:bold;"><%=</span>PARAMETER_1<span style="color:#000000;font-weight:bold;">%></span></td> | 60 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"center"</span>><span style="color:#006e28;font-weight:bold;"><%=</span>PARAMETER_1<span style="color:#006e28;font-weight:bold;">%></span></td> | ||
58 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"right"</span>>&quot;<span style="color:#000000;font-weight:bold;"><%=</span>parm1<span style="color:#000000;font-weight:bold;">%></span>&quot;</td> | 61 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"right"</span>>&quot;<span style="color:#006e28;font-weight:bold;"><%=</span>parm1<span style="color:#006e28;font-weight:bold;">%></span>&quot;</td> | ||
59 | </tr> | 62 | </tr> | ||
60 | 63 | | |||
61 | <span style="color:#898887;"><%-- Label; Actual Parameter String; Value Detected --%></span> | 64 | <span style="color:#898887;"><%-- Label; Actual Parameter String; Value Detected --%></span> | ||
62 | <tr> | 65 | <tr> | ||
63 | <td><b>PARAMETER_2</b></td> | 66 | <td><b>PARAMETER_2</b></td> | ||
64 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"center"</span>><span style="color:#000000;font-weight:bold;"><%=</span>PARAMETER_2<span style="color:#000000;font-weight:bold;">%></span></td> | 67 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"center"</span>><span style="color:#006e28;font-weight:bold;"><%=</span>PARAMETER_2<span style="color:#006e28;font-weight:bold;">%></span></td> | ||
65 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"right"</span>>&quot;<span style="color:#000000;font-weight:bold;"><%=</span>parm2<span style="color:#000000;font-weight:bold;">%></span>&quot;</td> | 68 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"right"</span>>&quot;<span style="color:#006e28;font-weight:bold;"><%=</span>parm2<span style="color:#006e28;font-weight:bold;">%></span>&quot;</td> | ||
66 | </tr> | 69 | </tr> | ||
67 | 70 | | |||
68 | <span style="color:#898887;"><%-- Label; Actual Parameter String; Value Detected --%></span> | 71 | <span style="color:#898887;"><%-- Label; Actual Parameter String; Value Detected --%></span> | ||
69 | <tr> | 72 | <tr> | ||
70 | <td><b>PARAMETER_3</b></td> | 73 | <td><b>PARAMETER_3</b></td> | ||
71 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"center"</span>><span style="color:#000000;font-weight:bold;"><%=</span>PARAMETER_3<span style="color:#000000;font-weight:bold;">%></span></td> | 74 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"center"</span>><span style="color:#006e28;font-weight:bold;"><%=</span>PARAMETER_3<span style="color:#006e28;font-weight:bold;">%></span></td> | ||
72 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"right"</span>>&quot;<span style="color:#000000;font-weight:bold;"><%=</span>parm3<span style="color:#000000;font-weight:bold;">%></span>&quot;</td> | 75 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"right"</span>>&quot;<span style="color:#006e28;font-weight:bold;"><%=</span>parm3<span style="color:#006e28;font-weight:bold;">%></span>&quot;</td> | ||
73 | </tr> | 76 | </tr> | ||
74 | 77 | | |||
75 | <span style="color:#898887;"><%-- Label; Actual Parameter String; Value Detected --%></span> | 78 | <span style="color:#898887;"><%-- Label; Actual Parameter String; Value Detected --%></span> | ||
76 | <tr> | 79 | <tr> | ||
77 | <td><b>PARAMETER_4</b></td> | 80 | <td><b>PARAMETER_4</b></td> | ||
78 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"center"</span>><span style="color:#000000;font-weight:bold;"><%=</span>PARAMETER_4<span style="color:#000000;font-weight:bold;">%></span></td> | 81 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"center"</span>><span style="color:#006e28;font-weight:bold;"><%=</span>PARAMETER_4<span style="color:#006e28;font-weight:bold;">%></span></td> | ||
79 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"right"</span>>&quot;<span style="color:#000000;font-weight:bold;"><%=</span>parm4<span style="color:#000000;font-weight:bold;">%></span>&quot;</td> | 82 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"right"</span>>&quot;<span style="color:#006e28;font-weight:bold;"><%=</span>parm4<span style="color:#006e28;font-weight:bold;">%></span>&quot;</td> | ||
80 | </tr> | 83 | </tr> | ||
81 | 84 | | |||
82 | <span style="color:#898887;"><%-- Label; Actual Parameter String; Value Detected --%></span> | 85 | <span style="color:#898887;"><%-- Label; Actual Parameter String; Value Detected --%></span> | ||
83 | <tr> | 86 | <tr> | ||
84 | <td><b>PARAMETER_5</b></td> | 87 | <td><b>PARAMETER_5</b></td> | ||
85 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"center"</span>><span style="color:#000000;font-weight:bold;"><%=</span>PARAMETER_5<span style="color:#000000;font-weight:bold;">%></span></td> | 88 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"center"</span>><span style="color:#006e28;font-weight:bold;"><%=</span>PARAMETER_5<span style="color:#006e28;font-weight:bold;">%></span></td> | ||
86 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"right"</span>>&quot;<span style="color:#000000;font-weight:bold;"><%=</span>parm5<span style="color:#000000;font-weight:bold;">%></span>&quot;</td> | 89 | <td<span style="color:#006e28;"> align</span>=<span style="color:#0057ae;">"right"</span>>&quot;<span style="color:#006e28;font-weight:bold;"><%=</span>parm5<span style="color:#006e28;font-weight:bold;">%></span>&quot;</td> | ||
87 | </tr> | 90 | </tr> | ||
88 | </table> | 91 | </table> | ||
89 | 92 | | |||
90 | <br><br> | 93 | <br><br> | ||
91 | 94 | | |||
92 | <span style="color:#898887;"><%-- Display our list of random Integers (shows code folding). --%></span> | 95 | <span style="color:#898887;"><%-- Display our list of random Integers (shows code folding). --%></span> | ||
93 | <table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">"400"</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">"0"</span>> | 96 | <table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">"400"</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">"0"</span>> | ||
94 | <span style="color:#000000;font-weight:bold;"><%</span> | 97 | <span style="color:#006e28;font-weight:bold;"><%</span> | ||
95 | <span style="font-weight:bold;">if</span> (intList != <span style="font-weight:bold;">null</span> && intList.size() > <span style="color:#b08000;">0</span>) { | 98 | <span style="font-weight:bold;">if</span> (intList != <span style="font-weight:bold;">null</span> && intList.<span style="color:#644a9b;">size</span>() > <span style="color:#b08000;">0</span>) { | ||
96 | <span style="color:#000000;font-weight:bold;">%></span> | 99 | <span style="color:#006e28;font-weight:bold;">%></span> | ||
97 | <tr><td><b>Here are the elements of intList...</b></td></tr> | 100 | <tr><td><b>Here are the elements of intList...</b></td></tr> | ||
98 | <span style="color:#000000;font-weight:bold;"><%</span> | 101 | <span style="color:#006e28;font-weight:bold;"><%</span> | ||
99 | <span style="color:#0095ff;font-weight:bold;">Iterator</span> intListIt = intList.iterator(); | 102 | <span style="color:#644a9b;font-weight:bold;">Iterator</span> intListIt = intList.<span style="color:#644a9b;">iterator</span>(); | ||
100 | <span style="font-weight:bold;">while</span> (intListIt.hasNext()) { | 103 | <span style="font-weight:bold;">while</span> (intListIt.<span style="color:#644a9b;">hasNext</span>()) { | ||
101 | <span style="color:#0095ff;font-weight:bold;">Integer</span> i = (<span style="color:#0095ff;font-weight:bold;">Integer</span>) intListIt.next(); | 104 | <span style="color:#644a9b;font-weight:bold;">Integer</span> i = (<span style="color:#644a9b;font-weight:bold;">Integer</span>) intListIt.<span style="color:#644a9b;">next</span>(); | ||
102 | <span style="color:#000000;font-weight:bold;">%></span> | 105 | <span style="color:#006e28;font-weight:bold;">%></span> | ||
103 | <tr><td><span style="color:#000000;font-weight:bold;"><%=</span>i.toString()<span style="color:#000000;font-weight:bold;">%></span></td></tr> | 106 | <tr><td><span style="color:#006e28;font-weight:bold;"><%=</span>i.<span style="color:#644a9b;">toString</span>()<span style="color:#006e28;font-weight:bold;">%></span></td></tr> | ||
104 | <span style="color:#000000;font-weight:bold;"><%</span> | 107 | <span style="color:#006e28;font-weight:bold;"><%</span> | ||
105 | } | 108 | } | ||
106 | } <span style="font-weight:bold;">else</span> { | 109 | } <span style="font-weight:bold;">else</span> { | ||
107 | <span style="color:#000000;font-weight:bold;">%></span> | 110 | <span style="color:#006e28;font-weight:bold;">%></span> | ||
108 | <tr><td><font<span style="color:#006e28;"> color</span>=<span style="color:#0057ae;">"blue"</span>><b><i>Oooops, we forgot to initialize intList!</i></b></font></td></tr> | 111 | <tr><td><font<span style="color:#006e28;"> color</span>=<span style="color:#0057ae;">"blue"</span>><b><i>Oooops, we forgot to initialize intList!</i></b></font></td></tr> | ||
109 | <span style="color:#000000;font-weight:bold;"><%</span> | 112 | <span style="color:#006e28;font-weight:bold;"><%</span> | ||
110 | } | 113 | } | ||
111 | <span style="color:#000000;font-weight:bold;">%></span> | 114 | <span style="color:#006e28;font-weight:bold;">%></span> | ||
112 | </table> | 115 | </table> | ||
113 | 116 | | |||
114 | <br><br> | 117 | <br><br> | ||
115 | 118 | | |||
116 | <span style="color:#898887;"><%-- We can call javascript functions. --%></span> | 119 | <span style="color:#898887;"><%-- We can call javascript functions. --%></span> | ||
117 | <table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">"400"</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">"0"</span>> | 120 | <table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">"400"</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">"0"</span>> | ||
118 | <tr><td<span style="color:#006e28;"> colspan</span>=<span style="color:#0057ae;">"2"</span>><b>Test our javascript...</b></td></tr> | 121 | <tr><td<span style="color:#006e28;"> colspan</span>=<span style="color:#0057ae;">"2"</span>><b>Test our javascript...</b></td></tr> | ||
119 | <tr> | 122 | <tr> | ||
Show All 11 Lines | 132 | <span style="font-weight:bold;"><my:SampleTag</span><span style="color:#006e28;"> prop1</span>=<span style="color:#0057ae;">"first"</span><span style="color:#006e28;"> prop2</span>=<span style="color:#0057ae;">"third"</span><span style="font-weight:bold;">></span> | |||
131 | <span style="font-weight:bold;"><my:SampleTagChild</span><span style="color:#006e28;"> nameProp</span>=<span style="color:#0057ae;">"value2"</span><span style="font-weight:bold;">/></span> | 134 | <span style="font-weight:bold;"><my:SampleTagChild</span><span style="color:#006e28;"> nameProp</span>=<span style="color:#0057ae;">"value2"</span><span style="font-weight:bold;">/></span> | ||
132 | <span style="font-weight:bold;"></my:SampleTag></span> | 135 | <span style="font-weight:bold;"></my:SampleTag></span> | ||
133 | </td></tr> | 136 | </td></tr> | ||
134 | </table> | 137 | </table> | ||
135 | 138 | | |||
136 | <br><br> | 139 | <br><br> | ||
137 | <span style="color:#898887;"><%-- Expression language. --%></span> | 140 | <span style="color:#898887;"><%-- Expression language. --%></span> | ||
138 | <table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">"400"</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">"0"</span>> | 141 | <table<span style="color:#006e28;"> width</span>=<span style="color:#0057ae;">"400"</span><span style="color:#006e28;"> cellpadding</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> cellspacing</span>=<span style="color:#0057ae;">"0"</span><span style="color:#006e28;"> border</span>=<span style="color:#0057ae;">"0"</span>> | ||
139 | <span style="font-weight:bold;"><c:if</span><span style="color:#006e28;"> test</span>=<span style="color:#0057ae;">"</span><span style="color:#000000;font-weight:bold;">${</span>!<span style="font-weight:bold;">empty</span> param.aParam<span style="color:#000000;font-weight:bold;">}</span><span style="color:#0057ae;">"</span><span style="font-weight:bold;">></span> | 142 | <span style="font-weight:bold;"><c:if</span><span style="color:#006e28;"> test</span>=<span style="color:#0057ae;">"</span><span style="color:#006e28;font-weight:bold;">${</span>!<span style="font-weight:bold;">empty</span> param.<span style="color:#644a9b;">aParam</span><span style="color:#006e28;font-weight:bold;">}</span><span style="color:#0057ae;">"</span><span style="font-weight:bold;">></span> | ||
140 | <span style="font-weight:bold;"><c:set</span><span style="color:#006e28;"> var</span>=<span style="color:#0057ae;">"myParam"</span><span style="color:#006e28;"> scope</span>=<span style="color:#0057ae;">"session"</span><span style="color:#006e28;"> value</span>=<span style="color:#0057ae;">"</span><span style="color:#000000;font-weight:bold;">${</span>param.aParam<span style="color:#000000;font-weight:bold;">}</span><span style="color:#0057ae;">"</span><span style="font-weight:bold;">/></span> | 143 | <span style="font-weight:bold;"><c:set</span><span style="color:#006e28;"> var</span>=<span style="color:#0057ae;">"myParam"</span><span style="color:#006e28;"> scope</span>=<span style="color:#0057ae;">"session"</span><span style="color:#006e28;"> value</span>=<span style="color:#0057ae;">"</span><span style="color:#006e28;font-weight:bold;">${</span>param.<span style="color:#644a9b;">aParam</span><span style="color:#006e28;font-weight:bold;">}</span><span style="color:#0057ae;">"</span><span style="font-weight:bold;">/></span> | ||
141 | <span style="font-weight:bold;"></c:if></span> | 144 | <span style="font-weight:bold;"></c:if></span> | ||
142 | 145 | | |||
143 | <tr><td>myParam's value: &quot;<span style="font-weight:bold;"><c:out</span><span style="color:#006e28;"> value</span>=<span style="color:#0057ae;">"</span><span style="color:#000000;font-weight:bold;">${</span>myParam<span style="color:#000000;font-weight:bold;">}</span><span style="color:#0057ae;">"</span><span style="color:#006e28;"> default</span>==<span style="color:#0057ae;">"Default"</span><span style="font-weight:bold;">/></span>&quot;</td></tr> | 146 | <tr><td>myParam's value: &quot;<span style="font-weight:bold;"><c:out</span><span style="color:#006e28;"> value</span>=<span style="color:#0057ae;">"</span><span style="color:#006e28;font-weight:bold;">${</span>myParam<span style="color:#006e28;font-weight:bold;">}</span><span style="color:#0057ae;">"</span><span style="color:#006e28;"> default</span>==<span style="color:#0057ae;">"Default"</span><span style="font-weight:bold;">/></span>&quot;</td></tr> | ||
144 | </table> | 147 | </table> | ||
145 | </body> | 148 | </body> | ||
146 | </html> | 149 | </html> | ||
147 | <span style="color:#000000;font-weight:bold;"><%!</span> | 150 | <span style="color:#006e28;font-weight:bold;"><%!</span> | ||
148 | <span style="color:#898887;">/* A place for class variables and functions... */</span> | 151 | <span style="color:#898887;">/* A place for class variables and functions... */</span> | ||
149 | 152 | | |||
150 | <span style="color:#898887;">// Define some sample parameter names that this page might understand.</span> | 153 | <span style="color:#898887;">// Define some sample parameter names that this page might understand.</span> | ||
151 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#0095ff;font-weight:bold;">String</span> PARAMETER_1 = <span style="color:#bf0303;">"p1"</span>; | 154 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#644a9b;font-weight:bold;">String</span> PARAMETER_1 = <span style="color:#bf0303;">"p1"</span>; | ||
152 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#0095ff;font-weight:bold;">String</span> PARAMETER_2 = <span style="color:#bf0303;">"p2"</span>; | 155 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#644a9b;font-weight:bold;">String</span> PARAMETER_2 = <span style="color:#bf0303;">"p2"</span>; | ||
153 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#0095ff;font-weight:bold;">String</span> PARAMETER_3 = <span style="color:#bf0303;">"p3"</span>; | 156 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#644a9b;font-weight:bold;">String</span> PARAMETER_3 = <span style="color:#bf0303;">"p3"</span>; | ||
154 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#0095ff;font-weight:bold;">String</span> PARAMETER_4 = <span style="color:#bf0303;">"p4"</span>; | 157 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#644a9b;font-weight:bold;">String</span> PARAMETER_4 = <span style="color:#bf0303;">"p4"</span>; | ||
155 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#0095ff;font-weight:bold;">String</span> PARAMETER_5 = <span style="color:#bf0303;">"p5"</span>; | 158 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0057ae;">final</span> <span style="color:#644a9b;font-weight:bold;">String</span> PARAMETER_5 = <span style="color:#bf0303;">"p5"</span>; | ||
156 | 159 | | |||
157 | <span style="color:#898887;">// Returns str trimmed, or an empty string if str is null.</span> | 160 | <span style="color:#898887;">// Returns str trimmed, or an empty string if str is null.</span> | ||
158 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0095ff;font-weight:bold;">String</span> noNull(<span style="color:#0095ff;font-weight:bold;">String</span> str) { | 161 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#644a9b;font-weight:bold;">String</span> <span style="color:#644a9b;">noNull</span>(<span style="color:#644a9b;font-weight:bold;">String</span> str) { | ||
159 | <span style="color:#0095ff;font-weight:bold;">String</span> retStr; | 162 | <span style="color:#644a9b;font-weight:bold;">String</span> retStr; | ||
160 | <span style="font-weight:bold;">if</span> (str == <span style="font-weight:bold;">null</span>) | 163 | <span style="font-weight:bold;">if</span> (str == <span style="font-weight:bold;">null</span>) | ||
161 | retStr = <span style="color:#bf0303;">""</span>; | 164 | retStr = <span style="color:#bf0303;">""</span>; | ||
162 | <span style="font-weight:bold;">else</span> | 165 | <span style="font-weight:bold;">else</span> | ||
163 | retStr = str.trim(); | 166 | retStr = str.<span style="color:#644a9b;">trim</span>(); | ||
164 | 167 | | |||
165 | <span style="font-weight:bold;">return</span> retStr; | 168 | <span style="font-weight:bold;">return</span> retStr; | ||
166 | } | 169 | } | ||
167 | 170 | | |||
168 | <span style="color:#898887;">// Returns a list of Integers with listSize elements.</span> | 171 | <span style="color:#898887;">// Returns a list of Integers with listSize elements.</span> | ||
169 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#0095ff;font-weight:bold;">List</span> getIntList(<span style="color:#0057ae;">int</span> listSize) { | 172 | <span style="font-weight:bold;">private</span> <span style="color:#0057ae;">static</span> <span style="color:#644a9b;font-weight:bold;">List</span> <span style="color:#644a9b;">getIntList</span>(<span style="color:#0057ae;">int</span> listSize) { | ||
170 | <span style="color:#0095ff;font-weight:bold;">ArrayList</span> retList = <span style="font-weight:bold;">new</span> <span style="color:#0095ff;font-weight:bold;">ArrayList</span>(listSize); | 173 | <span style="color:#644a9b;font-weight:bold;">ArrayList</span> retList = <span style="font-weight:bold;">new</span> <span style="color:#644a9b;font-weight:bold;">ArrayList</span>(listSize); | ||
171 | <span style="font-weight:bold;">for</span> (<span style="color:#0057ae;">int</span> i = <span style="color:#b08000;">0</span>; i < listSize; i++) | 174 | <span style="font-weight:bold;">for</span> (<span style="color:#0057ae;">int</span> i = <span style="color:#b08000;">0</span>; i < listSize; i++) | ||
172 | retList.add(<span style="font-weight:bold;">new</span> <span style="color:#0095ff;font-weight:bold;">Integer</span>( (<span style="color:#0057ae;">int</span>) (<span style="color:#0095ff;font-weight:bold;">Math</span>.random() * <span style="color:#b08000;">100</span>) )); | 175 | retList.<span style="color:#644a9b;">add</span>(<span style="font-weight:bold;">new</span> <span style="color:#644a9b;font-weight:bold;">Integer</span>( (<span style="color:#0057ae;">int</span>) (<span style="color:#644a9b;font-weight:bold;">Math</span>.<span style="color:#644a9b;">random</span>() * <span style="color:#b08000;">100</span>) )); | ||
173 | 176 | | |||
174 | <span style="font-weight:bold;">return</span> retList; | 177 | <span style="font-weight:bold;">return</span> retList; | ||
175 | } | 178 | } | ||
176 | <span style="color:#000000;font-weight:bold;">%></span> | 179 | <span style="color:#006e28;font-weight:bold;">%></span> | ||
177 | </pre></body></html> | 180 | </pre></body></html> |