001    package jsp.jsp2.el;
002    
003    import javax.servlet.*;
004    import javax.servlet.http.*;
005    import javax.servlet.jsp.*;
006    
007    public final class basic_002darithmetic_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<html>\n  <head>\n    <title>JSP 2.0 Expression Language - Basic Arithmetic</title>\n  </head>\n  <body>\n    <h1>JSP 2.0 Expression Language - Basic Arithmetic</h1>\n    <hr>\n    This example illustrates basic Expression Language arithmetic.\n    Addition (+), subtraction (-), multiplication (*), division (/ or div), \n");
043          out.write("    and modulus (% or mod) are all supported.  Error conditions, like\n    division by zero, are handled gracefully.\n    <br>\n    <blockquote>\n      <code>\n        <table border=\"1\">\n          <thead>\n\t    <td><b>EL Expression</b></td>\n\t    <td><b>Result</b></td>\n\t  </thead>\n\t  <tr>\n\t    <td>${1}</td>\n\t    <td>");
044          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${1}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
045          out.write("</td>\n\t  </tr>\n\t  <tr>\n\t    <td>${1 + 2}</td>\n\t    <td>");
046          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${1 + 2}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
047          out.write("</td>\n\t  </tr>\n\t  <tr>\n\t    <td>${1.2 + 2.3}</td>\n\t    <td>");
048          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${1.2 + 2.3}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
049          out.write("</td>\n\t  </tr>\n\t  <tr>\n\t    <td>${1.2E4 + 1.4}</td>\n\t    <td>");
050          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${1.2E4 + 1.4}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
051          out.write("</td>\n\t  </tr>\n\t  <tr>\n\t    <td>${-4 - 2}</td>\n\t    <td>");
052          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${-4 - 2}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
053          out.write("</td>\n\t  </tr>\n\t  <tr>\n\t    <td>${21 * 2}</td>\n\t    <td>");
054          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${21 * 2}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
055          out.write("</td>\n\t  </tr>\n\t  <tr>\n\t    <td>${3/4}</td>\n\t    <td>");
056          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${3/4}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
057          out.write("</td>\n\t  </tr>\n\t  <tr>\n\t    <td>${3 div 4}</td>\n\t    <td>");
058          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${3 div 4}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
059          out.write("</td>\n\t  </tr>\n\t  <tr>\n\t    <td>${3/0}</td>\n\t    <td>");
060          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${3/0}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
061          out.write("</td>\n\t  </tr>\n\t  <tr>\n\t    <td>${10%4}</td>\n\t    <td>");
062          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${10%4}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
063          out.write("</td>\n\t  </tr>\n\t  <tr>\n\t    <td>${10 mod 4}</td>\n\t    <td>");
064          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${10 mod 4}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
065          out.write("</td>\n\t  </tr>\n    <tr>\n      <td>${(1==2) ? 3 : 4}</td>\n      <td>");
066          out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${(1==2) ? 3 : 4}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
067          out.write("</td>\n    </tr>\n\t</table>\n      </code>\n    </blockquote>\n  </body>\n</html>\n");
068        } catch (Throwable t) {
069          if (!(t instanceof SkipPageException)){
070            out = _jspx_out;
071            if (out != null && out.getBufferSize() != 0)
072              out.clearBuffer();
073            if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
074          }
075        } finally {
076          if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
077        }
078      }
079    }