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 / plugin_jsp.class (.txt) < prev    next >
Encoding:
Java Class File  |  2004-05-17  |  4.4 KB  |  89 lines

  1. package org.apache.jsp.plugin;
  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 org.apache.jasper.runtime.HttpJspBase;
  17. import org.apache.jasper.runtime.JspSourceDependent;
  18.  
  19. public final class plugin_jsp extends HttpJspBase implements JspSourceDependent {
  20.    private static Vector _jspx_dependants;
  21.  
  22.    public List getDependants() {
  23.       return _jspx_dependants;
  24.    }
  25.  
  26.    public void _jspService(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
  27.       JspFactory _jspxFactory = null;
  28.       PageContext pageContext = null;
  29.       HttpSession session = null;
  30.       ServletContext application = null;
  31.       ServletConfig config = null;
  32.       JspWriter out = null;
  33.       JspWriter _jspx_out = null;
  34.       PageContext _jspx_page_context = null;
  35.  
  36.       try {
  37.          _jspxFactory = JspFactory.getDefaultFactory();
  38.          response.setContentType("text/html");
  39.          pageContext = _jspxFactory.getPageContext(this, request, response, (String)null, true, 8192, true);
  40.          _jspx_page_context = pageContext;
  41.          application = pageContext.getServletContext();
  42.          config = pageContext.getServletConfig();
  43.          session = pageContext.getSession();
  44.          out = pageContext.getOut();
  45.          out.write("<html>\r\n<!--\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<title> Plugin example </title>\r\n<body bgcolor=\"white\">\r\n<h3> Current time is : </h3>\r\n");
  46.          out.write("<OBJECT classid=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\" width=\"160\" height=\"150\" codebase=\"http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0\">");
  47.          out.write("\n");
  48.          out.write("<PARAM name=\"java_code\" value=\"Clock2.class\">");
  49.          out.write("\n");
  50.          out.write("<PARAM name=\"java_codebase\" value=\"applet\">");
  51.          out.write("\n");
  52.          out.write("<PARAM name=\"type\" value=\"application/x-java-applet;version=1.2\">");
  53.          out.write("\n");
  54.          out.write("<COMMENT>");
  55.          out.write("\n");
  56.          out.write("<EMBED type=\"application/x-java-applet;version=1.2\" width=\"160\" height=\"150\" pluginspage=\"http://java.sun.com/products/plugin/\" java_code=\"Clock2.class\" java_codebase=\"applet\"");
  57.          out.write("/>");
  58.          out.write("\n");
  59.          out.write("<NOEMBED>");
  60.          out.write("\n");
  61.          out.write("\r\n        Plugin tag OBJECT or EMBED not supported by browser.\r\n    ");
  62.          out.write("\n");
  63.          out.write("</NOEMBED>");
  64.          out.write("\n");
  65.          out.write("</COMMENT>");
  66.          out.write("\n");
  67.          out.write("</OBJECT>");
  68.          out.write("\n");
  69.          out.write("\r\n<p>\r\n<h4>\r\n<font color=red> \r\nThe above applet is loaded using the Java Plugin from a jsp page using the\r\nplugin tag.\r\n</font>\r\n</h4>\r\n</body>\r\n</html>\r\n");
  70.       } catch (Throwable t) {
  71.          if (!(t instanceof SkipPageException)) {
  72.             if (_jspx_out != null && _jspx_out.getBufferSize() != 0) {
  73.                _jspx_out.clearBuffer();
  74.             }
  75.  
  76.             if (_jspx_page_context != null) {
  77.                _jspx_page_context.handlePageException(t);
  78.             }
  79.          }
  80.       } finally {
  81.          if (_jspxFactory != null) {
  82.             _jspxFactory.releasePageContext(_jspx_page_context);
  83.          }
  84.  
  85.       }
  86.  
  87.    }
  88. }
  89.