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 / repeat_jsp.class (.txt) < prev    next >
Encoding:
Java Class File  |  2004-05-17  |  5.2 KB  |  88 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.RepeatSimpleTag;
  17. import org.apache.jasper.runtime.HttpJspBase;
  18. import org.apache.jasper.runtime.JspSourceDependent;
  19.  
  20. public final class repeat_jsp extends HttpJspBase implements JspSourceDependent {
  21.    private static Vector _jspx_dependants = new Vector(1);
  22.    // $FF: synthetic field
  23.    static Class class$java$lang$String;
  24.  
  25.    public List getDependants() {
  26.       return _jspx_dependants;
  27.    }
  28.  
  29.    public void _jspService(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
  30.       JspFactory _jspxFactory = null;
  31.       PageContext pageContext = null;
  32.       HttpSession session = null;
  33.       ServletContext application = null;
  34.       ServletConfig config = null;
  35.       JspWriter out = null;
  36.       JspWriter _jspx_out = null;
  37.       PageContext _jspx_page_context = null;
  38.  
  39.       try {
  40.          _jspxFactory = JspFactory.getDefaultFactory();
  41.          response.setContentType("text/html");
  42.          pageContext = _jspxFactory.getPageContext(this, request, response, (String)null, true, 8192, true);
  43.          _jspx_page_context = pageContext;
  44.          application = pageContext.getServletContext();
  45.          config = pageContext.getServletConfig();
  46.          session = pageContext.getSession();
  47.          out = pageContext.getOut();
  48.          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 - Repeat SimpleTag Handler</title>\r\n  </head>\r\n  <body>\r\n    <h1>JSP 2.0 Examples - Repeat SimpleTag Handler</h1>\r\n    <hr>\r\n    <p>This tag handler accepts a \"num\" parameter and repeats the body of the\r\n    tag \"num\" times.  It's a simple example, but the implementation of \r\n    such a tag in JSP 2.0 is substantially simpler than the equivalent \r\n    JSP 1.2-style classic tag handler.</p>\r\n");
  49.          out.write("    <p>The body of the tag is encapsulated in a \"JSP Fragment\" and passed\r\n    to the tag handler, which then executes it five times, inside a \r\n    for loop.  The tag handler passes in the current invocation in a\r\n    scoped variable called count, which can be accessed using the EL.</p>\r\n    <br>\r\n    <b><u>Result:</u></b><br>\r\n    ");
  50.          RepeatSimpleTag _jspx_th_mytag_repeat_0 = new RepeatSimpleTag();
  51.          _jspx_th_mytag_repeat_0.setJspContext(pageContext);
  52.          _jspx_th_mytag_repeat_0.setNum(5);
  53.          _jspx_th_mytag_repeat_0.setJspBody(new repeat_jspHelper(this, 0, pageContext, _jspx_th_mytag_repeat_0, (int[])null));
  54.          _jspx_th_mytag_repeat_0.doTag();
  55.          out.write("\r\n  </body>\r\n</html>\r\n");
  56.       } catch (Throwable t) {
  57.          if (!(t instanceof SkipPageException)) {
  58.             if (_jspx_out != null && _jspx_out.getBufferSize() != 0) {
  59.                _jspx_out.clearBuffer();
  60.             }
  61.  
  62.             if (_jspx_page_context != null) {
  63.                _jspx_page_context.handlePageException(t);
  64.             }
  65.          }
  66.       } finally {
  67.          if (_jspxFactory != null) {
  68.             _jspxFactory.releasePageContext(_jspx_page_context);
  69.          }
  70.  
  71.       }
  72.  
  73.    }
  74.  
  75.    // $FF: synthetic method
  76.    static Class class$(String x0) {
  77.       try {
  78.          return Class.forName(x0);
  79.       } catch (ClassNotFoundException x1) {
  80.          throw new NoClassDefFoundError(x1.getMessage());
  81.       }
  82.    }
  83.  
  84.    static {
  85.       _jspx_dependants.add("/WEB-INF/jsp2/jsp2-example-taglib.tld");
  86.    }
  87. }
  88.