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 / hello_jsp.class (.txt) < prev    next >
Encoding:
Java Class File  |  2004-05-17  |  4.2 KB  |  85 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.HelloWorldSimpleTag;
  17. import org.apache.jasper.runtime.HttpJspBase;
  18. import org.apache.jasper.runtime.JspSourceDependent;
  19.  
  20. public final class hello_jsp extends HttpJspBase implements JspSourceDependent {
  21.    private static Vector _jspx_dependants = new Vector(1);
  22.  
  23.    public List getDependants() {
  24.       return _jspx_dependants;
  25.    }
  26.  
  27.    public void _jspService(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
  28.       JspFactory _jspxFactory = null;
  29.       PageContext pageContext = null;
  30.       HttpSession session = null;
  31.       ServletContext application = null;
  32.       ServletConfig config = null;
  33.       JspWriter out = null;
  34.       JspWriter _jspx_out = null;
  35.       PageContext _jspx_page_context = null;
  36.  
  37.       try {
  38.          _jspxFactory = JspFactory.getDefaultFactory();
  39.          response.setContentType("text/html");
  40.          pageContext = _jspxFactory.getPageContext(this, request, response, (String)null, true, 8192, true);
  41.          _jspx_page_context = pageContext;
  42.          application = pageContext.getServletContext();
  43.          config = pageContext.getServletConfig();
  44.          session = pageContext.getSession();
  45.          out = pageContext.getOut();
  46.          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 - Hello World SimpleTag Handler</title>\r\n  </head>\r\n  <body>\r\n    <h1>JSP 2.0 Examples - Hello World SimpleTag Handler</h1>\r\n    <hr>\r\n    <p>This tag handler simply echos \"Hello, World!\"  It's an example of\r\n    a very basic SimpleTag handler with no body.</p>\r\n    <br>\r\n    <b><u>Result:</u></b>\r\n    ");
  47.          if (!this._jspx_meth_mytag_helloWorld_0(pageContext)) {
  48.             out.write("\r\n  </body>\r\n</html>\r\n");
  49.             return;
  50.          }
  51.       } catch (Throwable t) {
  52.          if (!(t instanceof SkipPageException)) {
  53.             if (_jspx_out != null && _jspx_out.getBufferSize() != 0) {
  54.                _jspx_out.clearBuffer();
  55.             }
  56.  
  57.             if (_jspx_page_context != null) {
  58.                _jspx_page_context.handlePageException(t);
  59.                return;
  60.             }
  61.          }
  62.  
  63.          return;
  64.       } finally {
  65.          if (_jspxFactory != null) {
  66.             _jspxFactory.releasePageContext(_jspx_page_context);
  67.          }
  68.  
  69.       }
  70.  
  71.    }
  72.  
  73.    private boolean _jspx_meth_mytag_helloWorld_0(PageContext _jspx_page_context) throws Throwable {
  74.       JspWriter out = _jspx_page_context.getOut();
  75.       HelloWorldSimpleTag _jspx_th_mytag_helloWorld_0 = new HelloWorldSimpleTag();
  76.       _jspx_th_mytag_helloWorld_0.setJspContext(_jspx_page_context);
  77.       _jspx_th_mytag_helloWorld_0.doTag();
  78.       return false;
  79.    }
  80.  
  81.    static {
  82.       _jspx_dependants.add("/WEB-INF/jsp2/jsp2-example-taglib.tld");
  83.    }
  84. }
  85.