001 package jsp.jsp2.simpletag;
002
003 import javax.servlet.*;
004 import javax.servlet.http.*;
005 import javax.servlet.jsp.*;
006
007 public final class book_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
012 static {
013 _jspx_fnmap_0= org.apache.jasper.runtime.ProtectedFunctionMapper.getMapForFunction("my:caps", jsp2.examples.el.Functions.class, "caps", new Class[] {java.lang.String.class});
014 }
015
016 private static java.util.List _jspx_dependants;
017
018 static {
019 _jspx_dependants = new java.util.ArrayList(1);
020 _jspx_dependants.add("/WEB-INF/jsp2/jsp2-example-taglib.tld");
021 }
022
023 public Object getDependants() {
024 return _jspx_dependants;
025 }
026
027 public void _jspService(HttpServletRequest request, HttpServletResponse response)
028 throws java.io.IOException, ServletException {
029
030 JspFactory _jspxFactory = null;
031 PageContext pageContext = null;
032 HttpSession session = null;
033 ServletContext application = null;
034 ServletConfig config = null;
035 JspWriter out = null;
036 Object page = this;
037 JspWriter _jspx_out = null;
038 PageContext _jspx_page_context = null;
039
040
041 try {
042 _jspxFactory = JspFactory.getDefaultFactory();
043 response.setContentType("text/html");
044 pageContext = _jspxFactory.getPageContext(this, request, response,
045 null, true, 8192, true);
046 _jspx_page_context = pageContext;
047 application = pageContext.getServletContext();
048 config = pageContext.getServletConfig();
049 session = pageContext.getSession();
050 out = pageContext.getOut();
051 _jspx_out = out;
052
053 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 - Book SimpleTag Handler</title>\n </head>\n <body>\n <h1>JSP 2.0 Examples - Book SimpleTag Handler</h1>\n <hr>\n <p>Illustrates a semi-realistic use of SimpleTag and the Expression \n Language. First, a <my:findBook> tag is invoked to populate \n");
054 out.write(" the page context with a BookBean. Then, the books fields are printed \n in all caps.</p>\n <br>\n <b><u>Result:</u></b><br>\n ");
055 if (_jspx_meth_my_findBook_0(_jspx_page_context))
056 return;
057 out.write("\n <table border=\"1\">\n <thead>\n\t <td><b>Field</b></td>\n\t <td><b>Value</b></td>\n\t <td><b>Capitalized</b></td>\n\t</thead>\n\t<tr>\n\t <td>Title</td>\n\t <td>");
058 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${book.title}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
059 out.write("</td>\n\t <td>");
060 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${my:caps(book.title)}", 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>Author</td>\n\t <td>");
062 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${book.author}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
063 out.write("</td>\n\t <td>");
064 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${my:caps(book.author)}", java.lang.String.class, (PageContext)_jspx_page_context, _jspx_fnmap_0, false));
065 out.write("</td>\n\t</tr>\n\t<tr>\n\t <td>ISBN</td>\n\t <td>");
066 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${book.isbn}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
067 out.write("</td>\n\t <td>");
068 out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${my:caps(book.isbn)}", java.lang.String.class, (PageContext)_jspx_page_context, _jspx_fnmap_0, false));
069 out.write("</td>\n\t</tr>\n </table>\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_my_findBook_0(PageContext _jspx_page_context)
083 throws Throwable {
084 PageContext pageContext = _jspx_page_context;
085 JspWriter out = _jspx_page_context.getOut();
086 // my:findBook
087 jsp2.examples.simpletag.FindBookSimpleTag _jspx_th_my_findBook_0 = new jsp2.examples.simpletag.FindBookSimpleTag();
088 _jspx_th_my_findBook_0.setJspContext(_jspx_page_context);
089 _jspx_th_my_findBook_0.setVar("book");
090 _jspx_th_my_findBook_0.doTag();
091 return false;
092 }
093 }