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 functions_jsp extends org.apache.jasper.runtime.HttpJspBase
008 implements org.apache.jasper.runtime.JspSourceDependent {
009
010 static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_0;
011 static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_1;
012 static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_2;
013
014 static {
015 _jspx_fnmap_0= org.apache.jasper.runtime.ProtectedFunctionMapper.getMapForFunction("fn:escapeXml", org.apache.taglibs.standard.functions.Functions.class, "escapeXml", new Class[] {java.lang.String.class});
016 _jspx_fnmap_1= org.apache.jasper.runtime.ProtectedFunctionMapper.getInstance();
017 _jspx_fnmap_1.mapFunction("my:reverse", jsp2.examples.el.Functions.class, "reverse", new Class[] {java.lang.String.class});
018 _jspx_fnmap_1.mapFunction("fn:escapeXml", org.apache.taglibs.standard.functions.Functions.class, "escapeXml", new Class[] {java.lang.String.class});
019 _jspx_fnmap_2= org.apache.jasper.runtime.ProtectedFunctionMapper.getInstance();
020 _jspx_fnmap_2.mapFunction("my:countVowels", jsp2.examples.el.Functions.class, "numVowels", new Class[] {java.lang.String.class});
021 _jspx_fnmap_2.mapFunction("fn:escapeXml", org.apache.taglibs.standard.functions.Functions.class, "escapeXml", new Class[] {java.lang.String.class});
022 }
023
024 private static java.util.List _jspx_dependants;
025
026 public Object getDependants() {
027 return _jspx_dependants;
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\n\n\n<html>\n <head>\n <title>JSP 2.0 Expression Language - Functions</title>\n </head>\n <body>\n <h1>JSP 2.0 Expression Language - Functions</h1>\n <hr>\n An upgrade from the JSTL expression language, the JSP 2.0 EL also\n allows for simple function invocation. Functions are defined\n");
057 out.write(" by tag libraries and are implemented by a Java programmer as \n static methods.\n\n <blockquote>\n <u><b>Change Parameter</b></u>\n <form action=\"functions.jsp\" method=\"GET\">\n\t foo = <input type=\"text\" name=\"foo\" value=\"");
058 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${fn:escapeXml(param[\"foo\"])}", java.lang.String.class, (PageContext)_jspx_page_context, _jspx_fnmap_0, false));
059 out.write("\">\n <input type=\"submit\">\n </form>\n <br>\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>${param[\"foo\"]}</td>\n\t <td>");
060 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${fn:escapeXml(param[\"foo\"])}", java.lang.String.class, (PageContext)_jspx_page_context, _jspx_fnmap_0, false));
061 out.write(" </td>\n\t </tr>\n\t <tr>\n\t <td>${my:reverse(param[\"foo\"])}</td>\n\t <td>");
062 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${my:reverse(fn:escapeXml(param[\"foo\"]))}", java.lang.String.class, (PageContext)_jspx_page_context, _jspx_fnmap_1, false));
063 out.write(" </td>\n\t </tr>\n\t <tr>\n\t <td>${my:reverse(my:reverse(param[\"foo\"]))}</td>\n\t <td>");
064 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${my:reverse(my:reverse(fn:escapeXml(param[\"foo\"])))}", java.lang.String.class, (PageContext)_jspx_page_context, _jspx_fnmap_1, false));
065 out.write(" </td>\n\t </tr>\n\t <tr>\n\t <td>${my:countVowels(param[\"foo\"])}</td>\n\t <td>");
066 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${my:countVowels(fn:escapeXml(param[\"foo\"]))}", java.lang.String.class, (PageContext)_jspx_page_context, _jspx_fnmap_2, false));
067 out.write(" </td>\n\t </tr>\n\t</table>\n </code>\n </blockquote>\n </body>\n</html>\n\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 }