Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
771 blopes 1
<!DOCTYPE html><html><head><meta charset="UTF-8" /><title>Source Code</title></head><body><pre>&lt;%--
2
 Licensed to the Apache Software Foundation (ASF) under one or more
3
  contributor license agreements.  See the NOTICE file distributed with
4
  this work for additional information regarding copyright ownership.
5
  The ASF licenses this file to You under the Apache License, Version 2.0
6
  (the "License"); you may not use this file except in compliance with
7
  the License.  You may obtain a copy of the License at
8
 
9
      http://www.apache.org/licenses/LICENSE-2.0
10
 
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
16
--%>
17
&lt;%@ taglib prefix="my" uri="http://tomcat.apache.org/jsp2-example-taglib"%>
18
 
19
&lt;html>
20
  &lt;head>
21
    &lt;title>JSP 2.0 Examples - Shuffle Example&lt;/title>
22
  &lt;/head>
23
  &lt;body>
24
    &lt;h1>JSP 2.0 Examples - Shuffle Example&lt;/h1>
25
    &lt;hr>
26
    &lt;p>Try reloading the page a few times.  Both the rows and the columns
27
    are shuffled and appear different each time.&lt;/p>
28
    &lt;p>Here's how the code works.  The SimpleTag handler called
29
    &amp;lt;my:shuffle&amp;gt; accepts three attributes.  Each attribute is a
30
    JSP Fragment, meaning it is a fragment of JSP code that can be
31
    dynamically executed by the shuffle tag handler on demand.  The
32
    shuffle tag handler executes the three fragments in a random order.
33
    To shuffle both the rows and the columns, the shuffle tag is used
34
    with itself as a parameter.&lt;/p>
35
    &lt;hr>
36
    &lt;blockquote>
37
     &lt;font color="#ffffff">
38
      &lt;table>
39
        &lt;my:shuffle>
40
          &lt;jsp:attribute name="fragment1">
41
            &lt;tr>
42
              &lt;my:shuffle>
43
                &lt;jsp:attribute name="fragment1">
44
                  &lt;my:tile color="#ff0000" label="A"/>
45
                &lt;/jsp:attribute>
46
                &lt;jsp:attribute name="fragment2">
47
                  &lt;my:tile color="#00ff00" label="B"/>
48
                &lt;/jsp:attribute>
49
                &lt;jsp:attribute name="fragment3">
50
                  &lt;my:tile color="#0000ff" label="C"/>
51
                &lt;/jsp:attribute>
52
              &lt;/my:shuffle>
53
            &lt;/tr>
54
          &lt;/jsp:attribute>
55
          &lt;jsp:attribute name="fragment2">
56
            &lt;tr>
57
              &lt;my:shuffle>
58
                &lt;jsp:attribute name="fragment1">
59
                  &lt;my:tile color="#ff0000" label="1"/>
60
                &lt;/jsp:attribute>
61
                &lt;jsp:attribute name="fragment2">
62
                  &lt;my:tile color="#00ff00" label="2"/>
63
                &lt;/jsp:attribute>
64
                &lt;jsp:attribute name="fragment3">
65
                  &lt;my:tile color="#0000ff" label="3"/>
66
                &lt;/jsp:attribute>
67
              &lt;/my:shuffle>
68
            &lt;/tr>
69
          &lt;/jsp:attribute>
70
          &lt;jsp:attribute name="fragment3">
71
            &lt;tr>
72
              &lt;my:shuffle>
73
                &lt;jsp:attribute name="fragment1">
74
                  &lt;my:tile color="#ff0000" label="!"/>
75
                &lt;/jsp:attribute>
76
                &lt;jsp:attribute name="fragment2">
77
                  &lt;my:tile color="#00ff00" label="@"/>
78
                &lt;/jsp:attribute>
79
                &lt;jsp:attribute name="fragment3">
80
                  &lt;my:tile color="#0000ff" label="#"/>
81
                &lt;/jsp:attribute>
82
              &lt;/my:shuffle>
83
            &lt;/tr>
84
          &lt;/jsp:attribute>
85
        &lt;/my:shuffle>
86
      &lt;/table>
87
     &lt;/font>
88
    &lt;/blockquote>
89
  &lt;/body>
90
&lt;/html>
91
</pre></body></html>