001    package jsp.jsp2.misc;
002    
003    import javax.servlet.*;
004    import javax.servlet.http.*;
005    import javax.servlet.jsp.*;
006    
007    public final class dynamicattrs_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<html>\n  <head>\n    <title>JSP 2.0 Examples - Dynamic Attributes</title>\n  </head>\n  <body>\n    <h1>JSP 2.0 Examples - Dynamic Attributes</h1>\n    <hr>\n    <p>This JSP page invokes a custom tag that accepts a dynamic set \n    of attributes.  The tag echoes the name and value of all attributes\n");
043          out.write("    passed to it.</p>\n    <hr>\n    <h2>Invocation 1 (six attributes)</h2>\n    <ul>\n      ");
044          if (_jspx_meth_my_echoAttributes_0(_jspx_page_context))
045            return;
046          out.write("\n    </ul>\n    <h2>Invocation 2 (zero attributes)</h2>\n    <ul>\n      ");
047          if (_jspx_meth_my_echoAttributes_1(_jspx_page_context))
048            return;
049          out.write("\n    </ul>\n    <h2>Invocation 3 (three attributes)</h2>\n    <ul>\n      ");
050          if (_jspx_meth_my_echoAttributes_2(_jspx_page_context))
051            return;
052          out.write("\n    </ul>\n  </body>\n</html>\n");
053        } catch (Throwable t) {
054          if (!(t instanceof SkipPageException)){
055            out = _jspx_out;
056            if (out != null && out.getBufferSize() != 0)
057              out.clearBuffer();
058            if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
059          }
060        } finally {
061          if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
062        }
063      }
064    
065      private boolean _jspx_meth_my_echoAttributes_0(PageContext _jspx_page_context)
066              throws Throwable {
067        PageContext pageContext = _jspx_page_context;
068        JspWriter out = _jspx_page_context.getOut();
069        //  my:echoAttributes
070        jsp2.examples.simpletag.EchoAttributesTag _jspx_th_my_echoAttributes_0 = new jsp2.examples.simpletag.EchoAttributesTag();
071        _jspx_th_my_echoAttributes_0.setJspContext(_jspx_page_context);
072        _jspx_th_my_echoAttributes_0.setDynamicAttribute(null, "x", new String("1"));
073        _jspx_th_my_echoAttributes_0.setDynamicAttribute(null, "y", new String("2"));
074        _jspx_th_my_echoAttributes_0.setDynamicAttribute(null, "z", new String("3"));
075        _jspx_th_my_echoAttributes_0.setDynamicAttribute(null, "r", new String("red"));
076        _jspx_th_my_echoAttributes_0.setDynamicAttribute(null, "g", new String("green"));
077        _jspx_th_my_echoAttributes_0.setDynamicAttribute(null, "b", new String("blue"));
078        _jspx_th_my_echoAttributes_0.doTag();
079        return false;
080      }
081    
082      private boolean _jspx_meth_my_echoAttributes_1(PageContext _jspx_page_context)
083              throws Throwable {
084        PageContext pageContext = _jspx_page_context;
085        JspWriter out = _jspx_page_context.getOut();
086        //  my:echoAttributes
087        jsp2.examples.simpletag.EchoAttributesTag _jspx_th_my_echoAttributes_1 = new jsp2.examples.simpletag.EchoAttributesTag();
088        _jspx_th_my_echoAttributes_1.setJspContext(_jspx_page_context);
089        _jspx_th_my_echoAttributes_1.doTag();
090        return false;
091      }
092    
093      private boolean _jspx_meth_my_echoAttributes_2(PageContext _jspx_page_context)
094              throws Throwable {
095        PageContext pageContext = _jspx_page_context;
096        JspWriter out = _jspx_page_context.getOut();
097        //  my:echoAttributes
098        jsp2.examples.simpletag.EchoAttributesTag _jspx_th_my_echoAttributes_2 = new jsp2.examples.simpletag.EchoAttributesTag();
099        _jspx_th_my_echoAttributes_2.setJspContext(_jspx_page_context);
100        _jspx_th_my_echoAttributes_2.setDynamicAttribute(null, "dogName", new String("Scruffy"));
101        _jspx_th_my_echoAttributes_2.setDynamicAttribute(null, "catName", new String("Fluffy"));
102        _jspx_th_my_echoAttributes_2.setDynamicAttribute(null, "blowfishName", new String("Puffy"));
103        _jspx_th_my_echoAttributes_2.doTag();
104        return false;
105      }
106    }