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 products_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/displayProducts.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 - Display Products Tag File</title>\n  </head>\n  <body>\n    <h1>JSP 2.0 Examples - Display Products Tag File</h1>\n    <hr>\n    <p>This JSP page invokes a tag file that displays a listing of \n    products.  The custom tag accepts two fragments that enable\n");
048          out.write("    customization of appearance.  One for when the product is on sale\n    and one for normal price.</p>\n    <p>The tag is invoked twice, using different styles</p>\n    <hr>\n    <h2>Products</h2>\n    ");
049          //  tags:displayProducts
050          org.apache.jsp.tag.web.displayProducts_tag _jspx_th_tags_displayProducts_0 = new org.apache.jsp.tag.web.displayProducts_tag();
051          _jspx_th_tags_displayProducts_0.setJspContext(_jspx_page_context);
052          javax.servlet.jsp.tagext.JspFragment _jspx_temp0 = new products_jspHelper( 0, _jspx_page_context, _jspx_th_tags_displayProducts_0, null);
053          _jspx_th_tags_displayProducts_0.setNormalPrice(_jspx_temp0);
054          javax.servlet.jsp.tagext.JspFragment _jspx_temp1 = new products_jspHelper( 1, _jspx_page_context, _jspx_th_tags_displayProducts_0, null);
055          _jspx_th_tags_displayProducts_0.setOnSale(_jspx_temp1);
056          _jspx_th_tags_displayProducts_0.doTag();
057          out.write("\n    <hr>\n    <h2>Products (Same tag, alternate style)</h2>\n    ");
058          //  tags:displayProducts
059          org.apache.jsp.tag.web.displayProducts_tag _jspx_th_tags_displayProducts_1 = new org.apache.jsp.tag.web.displayProducts_tag();
060          _jspx_th_tags_displayProducts_1.setJspContext(_jspx_page_context);
061          javax.servlet.jsp.tagext.JspFragment _jspx_temp2 = new products_jspHelper( 2, _jspx_page_context, _jspx_th_tags_displayProducts_1, null);
062          _jspx_th_tags_displayProducts_1.setNormalPrice(_jspx_temp2);
063          javax.servlet.jsp.tagext.JspFragment _jspx_temp3 = new products_jspHelper( 3, _jspx_page_context, _jspx_th_tags_displayProducts_1, null);
064          _jspx_th_tags_displayProducts_1.setOnSale(_jspx_temp3);
065          _jspx_th_tags_displayProducts_1.doTag();
066          out.write("\n  </body>\n</html>\n");
067        } catch (Throwable t) {
068          if (!(t instanceof SkipPageException)){
069            out = _jspx_out;
070            if (out != null && out.getBufferSize() != 0)
071              out.clearBuffer();
072            if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
073          }
074        } finally {
075          if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
076        }
077      }
078    
079      private class products_jspHelper
080          extends org.apache.jasper.runtime.JspFragmentHelper
081      {
082        private javax.servlet.jsp.tagext.JspTag _jspx_parent;
083        private int[] _jspx_push_body_count;
084    
085        public products_jspHelper( int discriminator, JspContext jspContext, javax.servlet.jsp.tagext.JspTag _jspx_parent, int[] _jspx_push_body_count ) {
086          super( discriminator, jspContext, _jspx_parent );
087          this._jspx_parent = _jspx_parent;
088          this._jspx_push_body_count = _jspx_push_body_count;
089        }
090        public void invoke0( JspWriter out ) 
091          throws Throwable
092        {
093          out.write("Item: ");
094          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${name}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
095          out.write("<br/>\n\tPrice: ");
096          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${price}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
097          return;
098        }
099        public void invoke1( JspWriter out ) 
100          throws Throwable
101        {
102          out.write("Item: ");
103          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${name}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
104          out.write("<br/>\n\t<font color=\"red\"><strike>Was: ");
105          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${origPrice}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
106          out.write("</strike></font><br/>\n\t<b>Now: ");
107          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${salePrice}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
108          out.write("</b>");
109          return;
110        }
111        public void invoke2( JspWriter out ) 
112          throws Throwable
113        {
114          out.write('<');
115          out.write('b');
116          out.write('>');
117          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${name}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
118          out.write("</b> @ ");
119          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${price}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
120          out.write(" ea.");
121          return;
122        }
123        public void invoke3( JspWriter out ) 
124          throws Throwable
125        {
126          out.write('<');
127          out.write('b');
128          out.write('>');
129          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${name}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
130          out.write("</b> @ ");
131          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${salePrice}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
132          out.write(" ea. (was: ");
133          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${origPrice}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
134          out.write(')');
135          return;
136        }
137        public void invoke( java.io.Writer writer )
138          throws JspException
139        {
140          JspWriter out = null;
141          if( writer != null ) {
142            out = this.jspContext.pushBody(writer);
143          } else {
144            out = this.jspContext.getOut();
145          }
146          try {
147            switch( this.discriminator ) {
148              case 0:
149                invoke0( out );
150                break;
151              case 1:
152                invoke1( out );
153                break;
154              case 2:
155                invoke2( out );
156                break;
157              case 3:
158                invoke3( out );
159                break;
160            }
161          }
162          catch( Throwable e ) {
163            if (e instanceof SkipPageException)
164                throw (SkipPageException) e;
165            throw new JspException( e );
166          }
167          finally {
168            if( writer != null ) {
169              this.jspContext.popBody();
170            }
171          }
172        }
173      }
174    }