001    package jsp.jsp2.tagfiles;
002    
003    import javax.servlet.*;
004    import javax.servlet.http.*;
005    import javax.servlet.jsp.*;
006    
007    public final class panel_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      static {
013        _jspx_dependants = new java.util.ArrayList(1);
014        _jspx_dependants.add("/WEB-INF/tags/panel.tag");
015      }
016    
017      public Object getDependants() {
018        return _jspx_dependants;
019      }
020    
021      public void _jspService(HttpServletRequest request, HttpServletResponse response)
022            throws java.io.IOException, ServletException {
023    
024        JspFactory _jspxFactory = null;
025        PageContext pageContext = null;
026        HttpSession session = null;
027        ServletContext application = null;
028        ServletConfig config = null;
029        JspWriter out = null;
030        Object page = this;
031        JspWriter _jspx_out = null;
032        PageContext _jspx_page_context = null;
033    
034    
035        try {
036          _jspxFactory = JspFactory.getDefaultFactory();
037          response.setContentType("text/html");
038          pageContext = _jspxFactory.getPageContext(this, request, response,
039                            null, true, 8192, true);
040          _jspx_page_context = pageContext;
041          application = pageContext.getServletContext();
042          config = pageContext.getServletConfig();
043          session = pageContext.getSession();
044          out = pageContext.getOut();
045          _jspx_out = out;
046    
047          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<html>\n  <head>\n    <title>JSP 2.0 Examples - Panels using Tag Files</title>\n  </head>\n  <body>\n    <h1>JSP 2.0 Examples - Panels using Tag Files</h1>\n    <hr>\n    <p>This JSP page invokes a custom tag that draws a \n    panel around the contents of the tag body.  Normally, such a tag \n");
048          out.write("    implementation would require a Java class with many println() statements,\n    outputting HTML.  Instead, we can use a .tag file as a template,\n    and we don't need to write a single line of Java or even a TLD!</p>\n    <hr>\n    <table border=\"0\">\n      <tr valign=\"top\">\n        <td>\n          ");
049          if (_jspx_meth_tags_panel_0(_jspx_page_context))
050            return;
051          out.write("\n        </td>\n        <td>\n          ");
052          if (_jspx_meth_tags_panel_1(_jspx_page_context))
053            return;
054          out.write("\n        </td>\n        <td>\n          ");
055          if (_jspx_meth_tags_panel_2(_jspx_page_context))
056            return;
057          out.write("\n        </td>\n      </tr>\n    </table>\n  </body>\n</html>\n");
058        } catch (Throwable t) {
059          if (!(t instanceof SkipPageException)){
060            out = _jspx_out;
061            if (out != null && out.getBufferSize() != 0)
062              out.clearBuffer();
063            if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
064          }
065        } finally {
066          if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
067        }
068      }
069    
070      private boolean _jspx_meth_tags_panel_0(PageContext _jspx_page_context)
071              throws Throwable {
072        PageContext pageContext = _jspx_page_context;
073        JspWriter out = _jspx_page_context.getOut();
074        //  tags:panel
075        org.apache.jsp.tag.web.panel_tag _jspx_th_tags_panel_0 = new org.apache.jsp.tag.web.panel_tag();
076        _jspx_th_tags_panel_0.setJspContext(_jspx_page_context);
077        _jspx_th_tags_panel_0.setColor("#ff8080");
078        _jspx_th_tags_panel_0.setBgcolor("#ffc0c0");
079        _jspx_th_tags_panel_0.setTitle("Panel 1");
080        _jspx_th_tags_panel_0.setJspBody(new panel_jspHelper( 0, _jspx_page_context, _jspx_th_tags_panel_0, null));
081        _jspx_th_tags_panel_0.doTag();
082        return false;
083      }
084    
085      private boolean _jspx_meth_tags_panel_1(PageContext _jspx_page_context)
086              throws Throwable {
087        PageContext pageContext = _jspx_page_context;
088        JspWriter out = _jspx_page_context.getOut();
089        //  tags:panel
090        org.apache.jsp.tag.web.panel_tag _jspx_th_tags_panel_1 = new org.apache.jsp.tag.web.panel_tag();
091        _jspx_th_tags_panel_1.setJspContext(_jspx_page_context);
092        _jspx_th_tags_panel_1.setColor("#80ff80");
093        _jspx_th_tags_panel_1.setBgcolor("#c0ffc0");
094        _jspx_th_tags_panel_1.setTitle("Panel 2");
095        _jspx_th_tags_panel_1.setJspBody(new panel_jspHelper( 1, _jspx_page_context, _jspx_th_tags_panel_1, null));
096        _jspx_th_tags_panel_1.doTag();
097        return false;
098      }
099    
100      private boolean _jspx_meth_tags_panel_2(PageContext _jspx_page_context)
101              throws Throwable {
102        PageContext pageContext = _jspx_page_context;
103        JspWriter out = _jspx_page_context.getOut();
104        //  tags:panel
105        org.apache.jsp.tag.web.panel_tag _jspx_th_tags_panel_2 = new org.apache.jsp.tag.web.panel_tag();
106        _jspx_th_tags_panel_2.setJspContext(_jspx_page_context);
107        _jspx_th_tags_panel_2.setColor("#8080ff");
108        _jspx_th_tags_panel_2.setBgcolor("#c0c0ff");
109        _jspx_th_tags_panel_2.setTitle("Panel 3");
110        _jspx_th_tags_panel_2.setJspBody(new panel_jspHelper( 2, _jspx_page_context, _jspx_th_tags_panel_2, null));
111        _jspx_th_tags_panel_2.doTag();
112        return false;
113      }
114    
115      private boolean _jspx_meth_tags_panel_3(javax.servlet.jsp.tagext.JspTag _jspx_parent, PageContext _jspx_page_context)
116              throws Throwable {
117        PageContext pageContext = _jspx_page_context;
118        JspWriter out = _jspx_page_context.getOut();
119        //  tags:panel
120        org.apache.jsp.tag.web.panel_tag _jspx_th_tags_panel_3 = new org.apache.jsp.tag.web.panel_tag();
121        _jspx_th_tags_panel_3.setJspContext(_jspx_page_context);
122        _jspx_th_tags_panel_3.setParent(_jspx_parent);
123        _jspx_th_tags_panel_3.setColor("#ff80ff");
124        _jspx_th_tags_panel_3.setBgcolor("#ffc0ff");
125        _jspx_th_tags_panel_3.setTitle("Inner");
126        _jspx_th_tags_panel_3.setJspBody(new panel_jspHelper( 3, _jspx_page_context, _jspx_th_tags_panel_3, null));
127        _jspx_th_tags_panel_3.doTag();
128        return false;
129      }
130    
131      private class panel_jspHelper
132          extends org.apache.jasper.runtime.JspFragmentHelper
133      {
134        private javax.servlet.jsp.tagext.JspTag _jspx_parent;
135        private int[] _jspx_push_body_count;
136    
137        public panel_jspHelper( int discriminator, JspContext jspContext, javax.servlet.jsp.tagext.JspTag _jspx_parent, int[] _jspx_push_body_count ) {
138          super( discriminator, jspContext, _jspx_parent );
139          this._jspx_parent = _jspx_parent;
140          this._jspx_push_body_count = _jspx_push_body_count;
141        }
142        public boolean invoke0( JspWriter out ) 
143          throws Throwable
144        {
145          out.write("\n\t    First panel.<br/>\n\t  ");
146          return false;
147        }
148        public boolean invoke1( JspWriter out ) 
149          throws Throwable
150        {
151          out.write("\n\t    Second panel.<br/>\n\t    Second panel.<br/>\n\t    Second panel.<br/>\n\t    Second panel.<br/>\n\t  ");
152          return false;
153        }
154        public boolean invoke2( JspWriter out ) 
155          throws Throwable
156        {
157          out.write("\n\t    Third panel.<br/>\n            ");
158          if (_jspx_meth_tags_panel_3(_jspx_parent, _jspx_page_context))
159            return true;
160          out.write("\n\t    Third panel.<br/>\n\t  ");
161          return false;
162        }
163        public boolean invoke3( JspWriter out ) 
164          throws Throwable
165        {
166          out.write("\n\t      A panel in a panel.\n\t    ");
167          return false;
168        }
169        public void invoke( java.io.Writer writer )
170          throws JspException
171        {
172          JspWriter out = null;
173          if( writer != null ) {
174            out = this.jspContext.pushBody(writer);
175          } else {
176            out = this.jspContext.getOut();
177          }
178          try {
179            switch( this.discriminator ) {
180              case 0:
181                invoke0( out );
182                break;
183              case 1:
184                invoke1( out );
185                break;
186              case 2:
187                invoke2( out );
188                break;
189              case 3:
190                invoke3( out );
191                break;
192            }
193          }
194          catch( Throwable e ) {
195            if (e instanceof SkipPageException)
196                throw (SkipPageException) e;
197            throw new JspException( e );
198          }
199          finally {
200            if( writer != null ) {
201              this.jspContext.popBody();
202            }
203          }
204        }
205      }
206    }