001 package jsp.tagplugin;
002
003 import javax.servlet.*;
004 import javax.servlet.http.*;
005 import javax.servlet.jsp.*;
006
007 public final class if_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 private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_if_var_test_scope_nobody;
013 private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_if_test;
014
015 public Object getDependants() {
016 return _jspx_dependants;
017 }
018
019 public void _jspInit() {
020 _jspx_tagPool_c_if_var_test_scope_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
021 _jspx_tagPool_c_if_test = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
022 }
023
024 public void _jspDestroy() {
025 _jspx_tagPool_c_if_var_test_scope_nobody.release();
026 _jspx_tagPool_c_if_test.release();
027 }
028
029 public void _jspService(HttpServletRequest request, HttpServletResponse response)
030 throws java.io.IOException, ServletException {
031
032 JspFactory _jspxFactory = null;
033 PageContext pageContext = null;
034 HttpSession session = null;
035 ServletContext application = null;
036 ServletConfig config = null;
037 JspWriter out = null;
038 Object page = this;
039 JspWriter _jspx_out = null;
040 PageContext _jspx_page_context = null;
041
042
043 try {
044 _jspxFactory = JspFactory.getDefaultFactory();
045 response.setContentType("text/html");
046 pageContext = _jspxFactory.getPageContext(this, request, response,
047 null, true, 8192, true);
048 _jspx_page_context = pageContext;
049 application = pageContext.getServletContext();
050 config = pageContext.getServletConfig();
051 session = pageContext.getSession();
052 out = pageContext.getOut();
053 _jspx_out = out;
054
055 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: if</title>\n </head>\n <body>\n <h1>Tag Plugin Examples - <c:if></h1>\n\n <hr>\n </br>\n <a href=\"notes.html\">Plugin Introductory Notes<font <font color=\"#0000FF\"></a>\n <br/>\n <a href=\"howto.html\">Brief Instructions for Wrieting Plugins<font color=\"#0000FF\"></a>\n");
056 out.write(" <br/> <br/>\n <hr>\n\n <font color=\"#000000\"/>\n </br>\n \n\n <h3>Set the test result to a variable</h3>\n ");
057 if (_jspx_meth_c_if_0(_jspx_page_context))
058 return;
059 out.write("\n The result of testing for (1==1) is: ");
060 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${theTruth}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
061 out.write("\n\n <h3>Conditionally execute the body</h3>\n ");
062 if (_jspx_meth_c_if_1(_jspx_page_context))
063 return;
064 out.write("\n </body>\n</html> \n");
065 } catch (Throwable t) {
066 if (!(t instanceof SkipPageException)){
067 out = _jspx_out;
068 if (out != null && out.getBufferSize() != 0)
069 out.clearBuffer();
070 if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
071 }
072 } finally {
073 if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
074 }
075 }
076
077 private boolean _jspx_meth_c_if_0(PageContext _jspx_page_context)
078 throws Throwable {
079 PageContext pageContext = _jspx_page_context;
080 JspWriter out = _jspx_page_context.getOut();
081 // c:if
082 org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_if_0 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _jspx_tagPool_c_if_var_test_scope_nobody.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class);
083 _jspx_th_c_if_0.setPageContext(_jspx_page_context);
084 _jspx_th_c_if_0.setParent(null);
085 _jspx_th_c_if_0.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${1==1}", java.lang.Boolean.class, (PageContext)_jspx_page_context, null, false)).booleanValue());
086 _jspx_th_c_if_0.setVar("theTruth");
087 _jspx_th_c_if_0.setScope("session");
088 int _jspx_eval_c_if_0 = _jspx_th_c_if_0.doStartTag();
089 if (_jspx_th_c_if_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
090 _jspx_tagPool_c_if_var_test_scope_nobody.reuse(_jspx_th_c_if_0);
091 return true;
092 }
093 _jspx_tagPool_c_if_var_test_scope_nobody.reuse(_jspx_th_c_if_0);
094 return false;
095 }
096
097 private boolean _jspx_meth_c_if_1(PageContext _jspx_page_context)
098 throws Throwable {
099 PageContext pageContext = _jspx_page_context;
100 JspWriter out = _jspx_page_context.getOut();
101 // c:if
102 org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_if_1 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _jspx_tagPool_c_if_test.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class);
103 _jspx_th_c_if_1.setPageContext(_jspx_page_context);
104 _jspx_th_c_if_1.setParent(null);
105 _jspx_th_c_if_1.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${2>0}", java.lang.Boolean.class, (PageContext)_jspx_page_context, null, false)).booleanValue());
106 int _jspx_eval_c_if_1 = _jspx_th_c_if_1.doStartTag();
107 if (_jspx_eval_c_if_1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
108 do {
109 out.write("\n\tIt's true that (2>0)!\n ");
110 int evalDoAfterBody = _jspx_th_c_if_1.doAfterBody();
111 if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
112 break;
113 } while (true);
114 }
115 if (_jspx_th_c_if_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
116 _jspx_tagPool_c_if_test.reuse(_jspx_th_c_if_1);
117 return true;
118 }
119 _jspx_tagPool_c_if_test.reuse(_jspx_th_c_if_1);
120 return false;
121 }
122 }