001 package jsp.tagplugin;
002
003 import javax.servlet.*;
004 import javax.servlet.http.*;
005 import javax.servlet.jsp.*;
006 import java.util.Vector;
007
008 public final class foreach_jsp extends org.apache.jasper.runtime.HttpJspBase
009 implements org.apache.jasper.runtime.JspSourceDependent {
010
011 private static java.util.List _jspx_dependants;
012
013 private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_forEach_var_end_begin;
014 private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_forEach_var_items;
015
016 public Object getDependants() {
017 return _jspx_dependants;
018 }
019
020 public void _jspInit() {
021 _jspx_tagPool_c_forEach_var_end_begin = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
022 _jspx_tagPool_c_forEach_var_items = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
023 }
024
025 public void _jspDestroy() {
026 _jspx_tagPool_c_forEach_var_end_begin.release();
027 _jspx_tagPool_c_forEach_var_items.release();
028 }
029
030 public void _jspService(HttpServletRequest request, HttpServletResponse response)
031 throws java.io.IOException, ServletException {
032
033 JspFactory _jspxFactory = null;
034 PageContext pageContext = null;
035 HttpSession session = null;
036 ServletContext application = null;
037 ServletConfig config = null;
038 JspWriter out = null;
039 Object page = this;
040 JspWriter _jspx_out = null;
041 PageContext _jspx_page_context = null;
042
043
044 try {
045 _jspxFactory = JspFactory.getDefaultFactory();
046 response.setContentType("text/html");
047 pageContext = _jspxFactory.getPageContext(this, request, response,
048 null, true, 8192, true);
049 _jspx_page_context = pageContext;
050 application = pageContext.getServletContext();
051 config = pageContext.getServletConfig();
052 session = pageContext.getSession();
053 out = pageContext.getOut();
054 _jspx_out = out;
055
056 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<html>\n <head>\n <title>Tag Plugin Examples: forEach</title>\n </head>\n <body>\n <h1>Tag Plugin Examples - <c:forEach></h1>\n\n <hr>\n </br>\n <a href=\"notes.html\">Plugin Introductory Notes<font <font color=\"#0000FF\"></\na>\n <br/>\n");
057 out.write(" <a href=\"howto.html\">Brief Instructions for Writing Plugins<font color=\"#0000\nFF\"></a>\n <br/> <br/>\n <hr>\n\n <font color=\"#000000\"/>\n </br>\n\n \n \n\n <h3>Iterating over a range</h3>\n ");
058 if (_jspx_meth_c_forEach_0(_jspx_page_context))
059 return;
060 out.write("\n\n ");
061 Vector v = new Vector();
062 v.add("One"); v.add("Two"); v.add("Three"); v.add("Four");
063
064 pageContext.setAttribute("vector", v);
065
066 out.write("\n\n <h3>Iterating over a Vector</h3>\n\n ");
067 if (_jspx_meth_c_forEach_1(_jspx_page_context))
068 return;
069 out.write("\n </body>\n</html> \n");
070 } catch (Throwable t) {
071 if (!(t instanceof SkipPageException)){
072 out = _jspx_out;
073 if (out != null && out.getBufferSize() != 0)
074 out.clearBuffer();
075 if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
076 }
077 } finally {
078 if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
079 }
080 }
081
082 private boolean _jspx_meth_c_forEach_0(PageContext _jspx_page_context)
083 throws Throwable {
084 PageContext pageContext = _jspx_page_context;
085 JspWriter out = _jspx_page_context.getOut();
086 // c:forEach
087 org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_forEach_0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _jspx_tagPool_c_forEach_var_end_begin.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
088 _jspx_th_c_forEach_0.setPageContext(_jspx_page_context);
089 _jspx_th_c_forEach_0.setParent(null);
090 _jspx_th_c_forEach_0.setVar("item");
091 _jspx_th_c_forEach_0.setBegin(1);
092 _jspx_th_c_forEach_0.setEnd(10);
093 int[] _jspx_push_body_count_c_forEach_0 = new int[] { 0 };
094 try {
095 int _jspx_eval_c_forEach_0 = _jspx_th_c_forEach_0.doStartTag();
096 if (_jspx_eval_c_forEach_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
097 do {
098 out.write("\n ");
099 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${item}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
100 out.write("\n ");
101 int evalDoAfterBody = _jspx_th_c_forEach_0.doAfterBody();
102 if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
103 break;
104 } while (true);
105 }
106 if (_jspx_th_c_forEach_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
107 return true;
108 }
109 } catch (Throwable _jspx_exception) {
110 while (_jspx_push_body_count_c_forEach_0[0]-- > 0)
111 out = _jspx_page_context.popBody();
112 _jspx_th_c_forEach_0.doCatch(_jspx_exception);
113 } finally {
114 _jspx_th_c_forEach_0.doFinally();
115 _jspx_tagPool_c_forEach_var_end_begin.reuse(_jspx_th_c_forEach_0);
116 }
117 return false;
118 }
119
120 private boolean _jspx_meth_c_forEach_1(PageContext _jspx_page_context)
121 throws Throwable {
122 PageContext pageContext = _jspx_page_context;
123 JspWriter out = _jspx_page_context.getOut();
124 // c:forEach
125 org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_forEach_1 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _jspx_tagPool_c_forEach_var_items.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
126 _jspx_th_c_forEach_1.setPageContext(_jspx_page_context);
127 _jspx_th_c_forEach_1.setParent(null);
128 _jspx_th_c_forEach_1.setItems((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${vector}", java.lang.Object.class, (PageContext)_jspx_page_context, null, false));
129 _jspx_th_c_forEach_1.setVar("item");
130 int[] _jspx_push_body_count_c_forEach_1 = new int[] { 0 };
131 try {
132 int _jspx_eval_c_forEach_1 = _jspx_th_c_forEach_1.doStartTag();
133 if (_jspx_eval_c_forEach_1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
134 do {
135 out.write('\n');
136 out.write(' ');
137 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${item}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
138 out.write("\n ");
139 int evalDoAfterBody = _jspx_th_c_forEach_1.doAfterBody();
140 if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
141 break;
142 } while (true);
143 }
144 if (_jspx_th_c_forEach_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
145 return true;
146 }
147 } catch (Throwable _jspx_exception) {
148 while (_jspx_push_body_count_c_forEach_1[0]-- > 0)
149 out = _jspx_page_context.popBody();
150 _jspx_th_c_forEach_1.doCatch(_jspx_exception);
151 } finally {
152 _jspx_th_c_forEach_1.doFinally();
153 _jspx_tagPool_c_forEach_var_items.reuse(_jspx_th_c_forEach_1);
154 }
155 return false;
156 }
157 }