home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-tomcat-addon-1.4.9-installer.exe / book_jsp.class (.txt) < prev    next >
Encoding:
Java Class File  |  2004-05-17  |  6.4 KB  |  117 lines

  1. package org.apache.jsp.jsp2.simpletag;
  2.  
  3. import java.io.IOException;
  4. import java.util.List;
  5. import java.util.Vector;
  6. import javax.servlet.ServletConfig;
  7. import javax.servlet.ServletContext;
  8. import javax.servlet.ServletException;
  9. import javax.servlet.http.HttpServletRequest;
  10. import javax.servlet.http.HttpServletResponse;
  11. import javax.servlet.http.HttpSession;
  12. import javax.servlet.jsp.JspFactory;
  13. import javax.servlet.jsp.JspWriter;
  14. import javax.servlet.jsp.PageContext;
  15. import javax.servlet.jsp.SkipPageException;
  16. import jsp2.examples.simpletag.FindBookSimpleTag;
  17. import org.apache.jasper.runtime.HttpJspBase;
  18. import org.apache.jasper.runtime.JspSourceDependent;
  19. import org.apache.jasper.runtime.PageContextImpl;
  20. import org.apache.jasper.runtime.ProtectedFunctionMapper;
  21.  
  22. public final class book_jsp extends HttpJspBase implements JspSourceDependent {
  23.    private static ProtectedFunctionMapper _jspx_fnmap_0;
  24.    private static Vector _jspx_dependants;
  25.    // $FF: synthetic field
  26.    static Class class$jsp2$examples$el$Functions;
  27.    // $FF: synthetic field
  28.    static Class class$java$lang$String;
  29.  
  30.    public List getDependants() {
  31.       return _jspx_dependants;
  32.    }
  33.  
  34.    public void _jspService(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
  35.       JspFactory _jspxFactory = null;
  36.       PageContext pageContext = null;
  37.       HttpSession session = null;
  38.       ServletContext application = null;
  39.       ServletConfig config = null;
  40.       JspWriter out = null;
  41.       JspWriter _jspx_out = null;
  42.       PageContext _jspx_page_context = null;
  43.  
  44.       try {
  45.          _jspxFactory = JspFactory.getDefaultFactory();
  46.          response.setContentType("text/html");
  47.          pageContext = _jspxFactory.getPageContext(this, request, response, (String)null, true, 8192, true);
  48.          _jspx_page_context = pageContext;
  49.          application = pageContext.getServletContext();
  50.          config = pageContext.getServletConfig();
  51.          session = pageContext.getSession();
  52.          out = pageContext.getOut();
  53.          out.write("<!--\r\n  Copyright 2004 The Apache Software Foundation\r\n\r\n  Licensed under the Apache License, Version 2.0 (the \"License\");\r\n  you may not use this file except in compliance with the License.\r\n  You may obtain a copy of the License at\r\n\r\n      http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n  Unless required by applicable law or agreed to in writing, software\r\n  distributed under the License is distributed on an \"AS IS\" BASIS,\r\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n  See the License for the specific language governing permissions and\r\n  limitations under the License.\r\n-->\r\n\r\n<html>\r\n  <head>\r\n    <title>JSP 2.0 Examples - Book SimpleTag Handler</title>\r\n  </head>\r\n  <body>\r\n    <h1>JSP 2.0 Examples - Book SimpleTag Handler</h1>\r\n    <hr>\r\n    <p>Illustrates a semi-realistic use of SimpleTag and the Expression \r\n    Language.  First, a <my:findBook> tag is invoked to populate \r\n    the page context with a BookBean.  Then, the books fields are printed \r\n    in all caps.</p>\r\n");
  54.          out.write("    <br>\r\n    <b><u>Result:</u></b><br>\r\n    ");
  55.          if (!this._jspx_meth_my_findBook_0(pageContext)) {
  56.             out.write("\r\n    <table border=\"1\">\r\n        <thead>\r\n\t    <td><b>Field</b></td>\r\n\t    <td><b>Value</b></td>\r\n\t    <td><b>Capitalized</b></td>\r\n\t</thead>\r\n\t<tr>\r\n\t    <td>Title</td>\r\n\t    <td>");
  57.             out.write((String)PageContextImpl.proprietaryEvaluate("${book.title}", class$java$lang$String == null ? (class$java$lang$String = class$("java.lang.String")) : class$java$lang$String, pageContext, (ProtectedFunctionMapper)null, false));
  58.             out.write("</td>\r\n\t    <td>");
  59.             out.write((String)PageContextImpl.proprietaryEvaluate("${my:caps(book.title)}", class$java$lang$String == null ? (class$java$lang$String = class$("java.lang.String")) : class$java$lang$String, pageContext, _jspx_fnmap_0, false));
  60.             out.write("</td>\r\n\t</tr>\r\n\t<tr>\r\n\t    <td>Author</td>\r\n\t    <td>");
  61.             out.write((String)PageContextImpl.proprietaryEvaluate("${book.author}", class$java$lang$String == null ? (class$java$lang$String = class$("java.lang.String")) : class$java$lang$String, pageContext, (ProtectedFunctionMapper)null, false));
  62.             out.write("</td>\r\n\t    <td>");
  63.             out.write((String)PageContextImpl.proprietaryEvaluate("${my:caps(book.author)}", class$java$lang$String == null ? (class$java$lang$String = class$("java.lang.String")) : class$java$lang$String, pageContext, _jspx_fnmap_0, false));
  64.             out.write("</td>\r\n\t</tr>\r\n\t<tr>\r\n\t    <td>ISBN</td>\r\n\t    <td>");
  65.             out.write((String)PageContextImpl.proprietaryEvaluate("${book.isbn}", class$java$lang$String == null ? (class$java$lang$String = class$("java.lang.String")) : class$java$lang$String, pageContext, (ProtectedFunctionMapper)null, false));
  66.             out.write("</td>\r\n\t    <td>");
  67.             out.write((String)PageContextImpl.proprietaryEvaluate("${my:caps(book.isbn)}", class$java$lang$String == null ? (class$java$lang$String = class$("java.lang.String")) : class$java$lang$String, pageContext, _jspx_fnmap_0, false));
  68.             out.write("</td>\r\n\t</tr>\r\n    </table>\r\n  </body>\r\n</html>\r\n");
  69.             return;
  70.          }
  71.       } catch (Throwable t) {
  72.          if (!(t instanceof SkipPageException)) {
  73.             if (_jspx_out != null && _jspx_out.getBufferSize() != 0) {
  74.                _jspx_out.clearBuffer();
  75.             }
  76.  
  77.             if (_jspx_page_context != null) {
  78.                _jspx_page_context.handlePageException(t);
  79.                return;
  80.             }
  81.          }
  82.  
  83.          return;
  84.       } finally {
  85.          if (_jspxFactory != null) {
  86.             _jspxFactory.releasePageContext(_jspx_page_context);
  87.          }
  88.  
  89.       }
  90.  
  91.    }
  92.  
  93.    private boolean _jspx_meth_my_findBook_0(PageContext _jspx_page_context) throws Throwable {
  94.       JspWriter out = _jspx_page_context.getOut();
  95.       FindBookSimpleTag _jspx_th_my_findBook_0 = new FindBookSimpleTag();
  96.       _jspx_th_my_findBook_0.setJspContext(_jspx_page_context);
  97.       _jspx_th_my_findBook_0.setVar("book");
  98.       _jspx_th_my_findBook_0.doTag();
  99.       return false;
  100.    }
  101.  
  102.    // $FF: synthetic method
  103.    static Class class$(String x0) {
  104.       try {
  105.          return Class.forName(x0);
  106.       } catch (ClassNotFoundException x1) {
  107.          throw new NoClassDefFoundError(x1.getMessage());
  108.       }
  109.    }
  110.  
  111.    static {
  112.       _jspx_fnmap_0 = ProtectedFunctionMapper.getMapForFunction("my:caps", class$jsp2$examples$el$Functions == null ? (class$jsp2$examples$el$Functions = class$("jsp2.examples.el.Functions")) : class$jsp2$examples$el$Functions, "caps", new Class[]{class$java$lang$String == null ? (class$java$lang$String = class$("java.lang.String")) : class$java$lang$String});
  113.       _jspx_dependants = new Vector(1);
  114.       _jspx_dependants.add("/WEB-INF/jsp2/jsp2-example-taglib.tld");
  115.    }
  116. }
  117.