001    package jsp.jsp2.jspattribute;
002    
003    import javax.servlet.*;
004    import javax.servlet.http.*;
005    import javax.servlet.jsp.*;
006    
007    public final class shuffle_jsp extends org.apache.jasper.runtime.HttpJspBase
008        implements org.apache.jasper.runtime.JspSourceDependent {
009    
010      private static java.util.List _jspx_dependants;
011    
012      public Object getDependants() {
013        return _jspx_dependants;
014      }
015    
016      public void _jspService(HttpServletRequest request, HttpServletResponse response)
017            throws java.io.IOException, ServletException {
018    
019        JspFactory _jspxFactory = null;
020        PageContext pageContext = null;
021        HttpSession session = null;
022        ServletContext application = null;
023        ServletConfig config = null;
024        JspWriter out = null;
025        Object page = this;
026        JspWriter _jspx_out = null;
027        PageContext _jspx_page_context = null;
028    
029    
030        try {
031          _jspxFactory = JspFactory.getDefaultFactory();
032          response.setContentType("text/html");
033          pageContext = _jspxFactory.getPageContext(this, request, response,
034                            null, true, 8192, true);
035          _jspx_page_context = pageContext;
036          application = pageContext.getServletContext();
037          config = pageContext.getServletConfig();
038          session = pageContext.getSession();
039          out = pageContext.getOut();
040          _jspx_out = out;
041    
042          out.write("<!--\n Licensed to the Apache Software Foundation (ASF) under one or more\n  contributor license agreements.  See the NOTICE file distributed with\n  this work for additional information regarding copyright ownership.\n  The ASF licenses this file to You under the Apache License, Version 2.0\n  (the \"License\"); you may not use this file except in compliance with\n  the License.  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n-->\n\n\n<html>\n  <head>\n    <title>JSP 2.0 Examples - Shuffle Example</title>\n  </head>\n  <body>\n    <h1>JSP 2.0 Examples - Shuffle Example</h1>\n    <hr>\n    <p>Try reloading the page a few times.  Both the rows and the columns\n    are shuffled and appear different each time.</p>\n");
043          out.write("    <p>Here's how the code works.  The SimpleTag handler called \n    &lt;my:shuffle&gt; accepts three attributes.  Each attribute is a \n    JSP Fragment, meaning it is a fragment of JSP code that can be\n    dynamically executed by the shuffle tag handler on demand.  The \n    shuffle tag handler executes the three fragments in a random order.\n    To shuffle both the rows and the columns, the shuffle tag is used\n    with itself as a parameter.</p>\n    <hr>\n    <blockquote>\n     <font color=\"#ffffff\">\n      <table>\n        ");
044          if (_jspx_meth_my_shuffle_0(_jspx_page_context))
045            return;
046          out.write("\n      </table>\n     </font>\n    </blockquote>\n  </body>\n</html>\n");
047        } catch (Throwable t) {
048          if (!(t instanceof SkipPageException)){
049            out = _jspx_out;
050            if (out != null && out.getBufferSize() != 0)
051              out.clearBuffer();
052            if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
053          }
054        } finally {
055          if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
056        }
057      }
058    
059      private boolean _jspx_meth_my_shuffle_0(PageContext _jspx_page_context)
060              throws Throwable {
061        PageContext pageContext = _jspx_page_context;
062        JspWriter out = _jspx_page_context.getOut();
063        //  my:shuffle
064        jsp2.examples.simpletag.ShuffleSimpleTag _jspx_th_my_shuffle_0 = new jsp2.examples.simpletag.ShuffleSimpleTag();
065        _jspx_th_my_shuffle_0.setJspContext(_jspx_page_context);
066        javax.servlet.jsp.tagext.JspFragment _jspx_temp0 = new shuffle_jspHelper( 0, _jspx_page_context, _jspx_th_my_shuffle_0, null);
067        _jspx_th_my_shuffle_0.setFragment1(_jspx_temp0);
068        javax.servlet.jsp.tagext.JspFragment _jspx_temp4 = new shuffle_jspHelper( 4, _jspx_page_context, _jspx_th_my_shuffle_0, null);
069        _jspx_th_my_shuffle_0.setFragment2(_jspx_temp4);
070        javax.servlet.jsp.tagext.JspFragment _jspx_temp8 = new shuffle_jspHelper( 8, _jspx_page_context, _jspx_th_my_shuffle_0, null);
071        _jspx_th_my_shuffle_0.setFragment3(_jspx_temp8);
072        _jspx_th_my_shuffle_0.doTag();
073        return false;
074      }
075    
076      private boolean _jspx_meth_my_shuffle_1(javax.servlet.jsp.tagext.JspTag _jspx_parent, PageContext _jspx_page_context)
077              throws Throwable {
078        PageContext pageContext = _jspx_page_context;
079        JspWriter out = _jspx_page_context.getOut();
080        //  my:shuffle
081        jsp2.examples.simpletag.ShuffleSimpleTag _jspx_th_my_shuffle_1 = new jsp2.examples.simpletag.ShuffleSimpleTag();
082        _jspx_th_my_shuffle_1.setJspContext(_jspx_page_context);
083        _jspx_th_my_shuffle_1.setParent(_jspx_parent);
084        javax.servlet.jsp.tagext.JspFragment _jspx_temp1 = new shuffle_jspHelper( 1, _jspx_page_context, _jspx_th_my_shuffle_1, null);
085        _jspx_th_my_shuffle_1.setFragment1(_jspx_temp1);
086        javax.servlet.jsp.tagext.JspFragment _jspx_temp2 = new shuffle_jspHelper( 2, _jspx_page_context, _jspx_th_my_shuffle_1, null);
087        _jspx_th_my_shuffle_1.setFragment2(_jspx_temp2);
088        javax.servlet.jsp.tagext.JspFragment _jspx_temp3 = new shuffle_jspHelper( 3, _jspx_page_context, _jspx_th_my_shuffle_1, null);
089        _jspx_th_my_shuffle_1.setFragment3(_jspx_temp3);
090        _jspx_th_my_shuffle_1.doTag();
091        return false;
092      }
093    
094      private boolean _jspx_meth_my_tile_0(javax.servlet.jsp.tagext.JspTag _jspx_parent, PageContext _jspx_page_context)
095              throws Throwable {
096        PageContext pageContext = _jspx_page_context;
097        JspWriter out = _jspx_page_context.getOut();
098        //  my:tile
099        jsp2.examples.simpletag.TileSimpleTag _jspx_th_my_tile_0 = new jsp2.examples.simpletag.TileSimpleTag();
100        _jspx_th_my_tile_0.setJspContext(_jspx_page_context);
101        _jspx_th_my_tile_0.setParent(_jspx_parent);
102        _jspx_th_my_tile_0.setColor("#ff0000");
103        _jspx_th_my_tile_0.setLabel("A");
104        _jspx_th_my_tile_0.doTag();
105        return false;
106      }
107    
108      private boolean _jspx_meth_my_tile_1(javax.servlet.jsp.tagext.JspTag _jspx_parent, PageContext _jspx_page_context)
109              throws Throwable {
110        PageContext pageContext = _jspx_page_context;
111        JspWriter out = _jspx_page_context.getOut();
112        //  my:tile
113        jsp2.examples.simpletag.TileSimpleTag _jspx_th_my_tile_1 = new jsp2.examples.simpletag.TileSimpleTag();
114        _jspx_th_my_tile_1.setJspContext(_jspx_page_context);
115        _jspx_th_my_tile_1.setParent(_jspx_parent);
116        _jspx_th_my_tile_1.setColor("#00ff00");
117        _jspx_th_my_tile_1.setLabel("B");
118        _jspx_th_my_tile_1.doTag();
119        return false;
120      }
121    
122      private boolean _jspx_meth_my_tile_2(javax.servlet.jsp.tagext.JspTag _jspx_parent, PageContext _jspx_page_context)
123              throws Throwable {
124        PageContext pageContext = _jspx_page_context;
125        JspWriter out = _jspx_page_context.getOut();
126        //  my:tile
127        jsp2.examples.simpletag.TileSimpleTag _jspx_th_my_tile_2 = new jsp2.examples.simpletag.TileSimpleTag();
128        _jspx_th_my_tile_2.setJspContext(_jspx_page_context);
129        _jspx_th_my_tile_2.setParent(_jspx_parent);
130        _jspx_th_my_tile_2.setColor("#0000ff");
131        _jspx_th_my_tile_2.setLabel("C");
132        _jspx_th_my_tile_2.doTag();
133        return false;
134      }
135    
136      private boolean _jspx_meth_my_shuffle_2(javax.servlet.jsp.tagext.JspTag _jspx_parent, PageContext _jspx_page_context)
137              throws Throwable {
138        PageContext pageContext = _jspx_page_context;
139        JspWriter out = _jspx_page_context.getOut();
140        //  my:shuffle
141        jsp2.examples.simpletag.ShuffleSimpleTag _jspx_th_my_shuffle_2 = new jsp2.examples.simpletag.ShuffleSimpleTag();
142        _jspx_th_my_shuffle_2.setJspContext(_jspx_page_context);
143        _jspx_th_my_shuffle_2.setParent(_jspx_parent);
144        javax.servlet.jsp.tagext.JspFragment _jspx_temp5 = new shuffle_jspHelper( 5, _jspx_page_context, _jspx_th_my_shuffle_2, null);
145        _jspx_th_my_shuffle_2.setFragment1(_jspx_temp5);
146        javax.servlet.jsp.tagext.JspFragment _jspx_temp6 = new shuffle_jspHelper( 6, _jspx_page_context, _jspx_th_my_shuffle_2, null);
147        _jspx_th_my_shuffle_2.setFragment2(_jspx_temp6);
148        javax.servlet.jsp.tagext.JspFragment _jspx_temp7 = new shuffle_jspHelper( 7, _jspx_page_context, _jspx_th_my_shuffle_2, null);
149        _jspx_th_my_shuffle_2.setFragment3(_jspx_temp7);
150        _jspx_th_my_shuffle_2.doTag();
151        return false;
152      }
153    
154      private boolean _jspx_meth_my_tile_3(javax.servlet.jsp.tagext.JspTag _jspx_parent, PageContext _jspx_page_context)
155              throws Throwable {
156        PageContext pageContext = _jspx_page_context;
157        JspWriter out = _jspx_page_context.getOut();
158        //  my:tile
159        jsp2.examples.simpletag.TileSimpleTag _jspx_th_my_tile_3 = new jsp2.examples.simpletag.TileSimpleTag();
160        _jspx_th_my_tile_3.setJspContext(_jspx_page_context);
161        _jspx_th_my_tile_3.setParent(_jspx_parent);
162        _jspx_th_my_tile_3.setColor("#ff0000");
163        _jspx_th_my_tile_3.setLabel("1");
164        _jspx_th_my_tile_3.doTag();
165        return false;
166      }
167    
168      private boolean _jspx_meth_my_tile_4(javax.servlet.jsp.tagext.JspTag _jspx_parent, PageContext _jspx_page_context)
169              throws Throwable {
170        PageContext pageContext = _jspx_page_context;
171        JspWriter out = _jspx_page_context.getOut();
172        //  my:tile
173        jsp2.examples.simpletag.TileSimpleTag _jspx_th_my_tile_4 = new jsp2.examples.simpletag.TileSimpleTag();
174        _jspx_th_my_tile_4.setJspContext(_jspx_page_context);
175        _jspx_th_my_tile_4.setParent(_jspx_parent);
176        _jspx_th_my_tile_4.setColor("#00ff00");
177        _jspx_th_my_tile_4.setLabel("2");
178        _jspx_th_my_tile_4.doTag();
179        return false;
180      }
181    
182      private boolean _jspx_meth_my_tile_5(javax.servlet.jsp.tagext.JspTag _jspx_parent, PageContext _jspx_page_context)
183              throws Throwable {
184        PageContext pageContext = _jspx_page_context;
185        JspWriter out = _jspx_page_context.getOut();
186        //  my:tile
187        jsp2.examples.simpletag.TileSimpleTag _jspx_th_my_tile_5 = new jsp2.examples.simpletag.TileSimpleTag();
188        _jspx_th_my_tile_5.setJspContext(_jspx_page_context);
189        _jspx_th_my_tile_5.setParent(_jspx_parent);
190        _jspx_th_my_tile_5.setColor("#0000ff");
191        _jspx_th_my_tile_5.setLabel("3");
192        _jspx_th_my_tile_5.doTag();
193        return false;
194      }
195    
196      private boolean _jspx_meth_my_shuffle_3(javax.servlet.jsp.tagext.JspTag _jspx_parent, PageContext _jspx_page_context)
197              throws Throwable {
198        PageContext pageContext = _jspx_page_context;
199        JspWriter out = _jspx_page_context.getOut();
200        //  my:shuffle
201        jsp2.examples.simpletag.ShuffleSimpleTag _jspx_th_my_shuffle_3 = new jsp2.examples.simpletag.ShuffleSimpleTag();
202        _jspx_th_my_shuffle_3.setJspContext(_jspx_page_context);
203        _jspx_th_my_shuffle_3.setParent(_jspx_parent);
204        javax.servlet.jsp.tagext.JspFragment _jspx_temp9 = new shuffle_jspHelper( 9, _jspx_page_context, _jspx_th_my_shuffle_3, null);
205        _jspx_th_my_shuffle_3.setFragment1(_jspx_temp9);
206        javax.servlet.jsp.tagext.JspFragment _jspx_temp10 = new shuffle_jspHelper( 10, _jspx_page_context, _jspx_th_my_shuffle_3, null);
207        _jspx_th_my_shuffle_3.setFragment2(_jspx_temp10);
208        javax.servlet.jsp.tagext.JspFragment _jspx_temp11 = new shuffle_jspHelper( 11, _jspx_page_context, _jspx_th_my_shuffle_3, null);
209        _jspx_th_my_shuffle_3.setFragment3(_jspx_temp11);
210        _jspx_th_my_shuffle_3.doTag();
211        return false;
212      }
213    
214      private boolean _jspx_meth_my_tile_6(javax.servlet.jsp.tagext.JspTag _jspx_parent, PageContext _jspx_page_context)
215              throws Throwable {
216        PageContext pageContext = _jspx_page_context;
217        JspWriter out = _jspx_page_context.getOut();
218        //  my:tile
219        jsp2.examples.simpletag.TileSimpleTag _jspx_th_my_tile_6 = new jsp2.examples.simpletag.TileSimpleTag();
220        _jspx_th_my_tile_6.setJspContext(_jspx_page_context);
221        _jspx_th_my_tile_6.setParent(_jspx_parent);
222        _jspx_th_my_tile_6.setColor("#ff0000");
223        _jspx_th_my_tile_6.setLabel("!");
224        _jspx_th_my_tile_6.doTag();
225        return false;
226      }
227    
228      private boolean _jspx_meth_my_tile_7(javax.servlet.jsp.tagext.JspTag _jspx_parent, PageContext _jspx_page_context)
229              throws Throwable {
230        PageContext pageContext = _jspx_page_context;
231        JspWriter out = _jspx_page_context.getOut();
232        //  my:tile
233        jsp2.examples.simpletag.TileSimpleTag _jspx_th_my_tile_7 = new jsp2.examples.simpletag.TileSimpleTag();
234        _jspx_th_my_tile_7.setJspContext(_jspx_page_context);
235        _jspx_th_my_tile_7.setParent(_jspx_parent);
236        _jspx_th_my_tile_7.setColor("#00ff00");
237        _jspx_th_my_tile_7.setLabel("@");
238        _jspx_th_my_tile_7.doTag();
239        return false;
240      }
241    
242      private boolean _jspx_meth_my_tile_8(javax.servlet.jsp.tagext.JspTag _jspx_parent, PageContext _jspx_page_context)
243              throws Throwable {
244        PageContext pageContext = _jspx_page_context;
245        JspWriter out = _jspx_page_context.getOut();
246        //  my:tile
247        jsp2.examples.simpletag.TileSimpleTag _jspx_th_my_tile_8 = new jsp2.examples.simpletag.TileSimpleTag();
248        _jspx_th_my_tile_8.setJspContext(_jspx_page_context);
249        _jspx_th_my_tile_8.setParent(_jspx_parent);
250        _jspx_th_my_tile_8.setColor("#0000ff");
251        _jspx_th_my_tile_8.setLabel("#");
252        _jspx_th_my_tile_8.doTag();
253        return false;
254      }
255    
256      private class shuffle_jspHelper
257          extends org.apache.jasper.runtime.JspFragmentHelper
258      {
259        private javax.servlet.jsp.tagext.JspTag _jspx_parent;
260        private int[] _jspx_push_body_count;
261    
262        public shuffle_jspHelper( int discriminator, JspContext jspContext, javax.servlet.jsp.tagext.JspTag _jspx_parent, int[] _jspx_push_body_count ) {
263          super( discriminator, jspContext, _jspx_parent );
264          this._jspx_parent = _jspx_parent;
265          this._jspx_push_body_count = _jspx_push_body_count;
266        }
267        public boolean invoke0( JspWriter out ) 
268          throws Throwable
269        {
270          out.write("<tr>\n              ");
271          if (_jspx_meth_my_shuffle_1(_jspx_parent, _jspx_page_context))
272            return true;
273          out.write("\n            </tr>");
274          return false;
275        }
276        public boolean invoke1( JspWriter out ) 
277          throws Throwable
278        {
279          if (_jspx_meth_my_tile_0(_jspx_parent, _jspx_page_context))
280            return true;
281          return false;
282        }
283        public boolean invoke2( JspWriter out ) 
284          throws Throwable
285        {
286          if (_jspx_meth_my_tile_1(_jspx_parent, _jspx_page_context))
287            return true;
288          return false;
289        }
290        public boolean invoke3( JspWriter out ) 
291          throws Throwable
292        {
293          if (_jspx_meth_my_tile_2(_jspx_parent, _jspx_page_context))
294            return true;
295          return false;
296        }
297        public boolean invoke4( JspWriter out ) 
298          throws Throwable
299        {
300          out.write("<tr>\n              ");
301          if (_jspx_meth_my_shuffle_2(_jspx_parent, _jspx_page_context))
302            return true;
303          out.write("\n            </tr>");
304          return false;
305        }
306        public boolean invoke5( JspWriter out ) 
307          throws Throwable
308        {
309          if (_jspx_meth_my_tile_3(_jspx_parent, _jspx_page_context))
310            return true;
311          return false;
312        }
313        public boolean invoke6( JspWriter out ) 
314          throws Throwable
315        {
316          if (_jspx_meth_my_tile_4(_jspx_parent, _jspx_page_context))
317            return true;
318          return false;
319        }
320        public boolean invoke7( JspWriter out ) 
321          throws Throwable
322        {
323          if (_jspx_meth_my_tile_5(_jspx_parent, _jspx_page_context))
324            return true;
325          return false;
326        }
327        public boolean invoke8( JspWriter out ) 
328          throws Throwable
329        {
330          out.write("<tr>\n              ");
331          if (_jspx_meth_my_shuffle_3(_jspx_parent, _jspx_page_context))
332            return true;
333          out.write("\n            </tr>");
334          return false;
335        }
336        public boolean invoke9( JspWriter out ) 
337          throws Throwable
338        {
339          if (_jspx_meth_my_tile_6(_jspx_parent, _jspx_page_context))
340            return true;
341          return false;
342        }
343        public boolean invoke10( JspWriter out ) 
344          throws Throwable
345        {
346          if (_jspx_meth_my_tile_7(_jspx_parent, _jspx_page_context))
347            return true;
348          return false;
349        }
350        public boolean invoke11( JspWriter out ) 
351          throws Throwable
352        {
353          if (_jspx_meth_my_tile_8(_jspx_parent, _jspx_page_context))
354            return true;
355          return false;
356        }
357        public void invoke( java.io.Writer writer )
358          throws JspException
359        {
360          JspWriter out = null;
361          if( writer != null ) {
362            out = this.jspContext.pushBody(writer);
363          } else {
364            out = this.jspContext.getOut();
365          }
366          try {
367            switch( this.discriminator ) {
368              case 0:
369                invoke0( out );
370                break;
371              case 1:
372                invoke1( out );
373                break;
374              case 2:
375                invoke2( out );
376                break;
377              case 3:
378                invoke3( out );
379                break;
380              case 4:
381                invoke4( out );
382                break;
383              case 5:
384                invoke5( out );
385                break;
386              case 6:
387                invoke6( out );
388                break;
389              case 7:
390                invoke7( out );
391                break;
392              case 8:
393                invoke8( out );
394                break;
395              case 9:
396                invoke9( out );
397                break;
398              case 10:
399                invoke10( out );
400                break;
401              case 11:
402                invoke11( out );
403                break;
404            }
405          }
406          catch( Throwable e ) {
407            if (e instanceof SkipPageException)
408                throw (SkipPageException) e;
409            throw new JspException( e );
410          }
411          finally {
412            if( writer != null ) {
413              this.jspContext.popBody();
414            }
415          }
416        }
417      }
418    }