001    package jsp.include;
002    
003    import javax.servlet.*;
004    import javax.servlet.http.*;
005    import javax.servlet.jsp.*;
006    
007    public final class include_jsp extends org.apache.jasper.runtime.HttpJspBase
008        implements org.apache.jasper.runtime.JspSourceDependent {
009    
010      private static java.util.List _jspx_dependants;
011    
012      static {
013        _jspx_dependants = new java.util.ArrayList(1);
014        _jspx_dependants.add("/include/foo.jsp");
015      }
016    
017      public Object getDependants() {
018        return _jspx_dependants;
019      }
020    
021      public void _jspService(HttpServletRequest request, HttpServletResponse response)
022            throws java.io.IOException, ServletException {
023    
024        JspFactory _jspxFactory = null;
025        PageContext pageContext = null;
026        HttpSession session = null;
027        ServletContext application = null;
028        ServletConfig config = null;
029        JspWriter out = null;
030        Object page = this;
031        JspWriter _jspx_out = null;
032        PageContext _jspx_page_context = null;
033    
034    
035        try {
036          _jspxFactory = JspFactory.getDefaultFactory();
037          response.setContentType("text/html");
038          pageContext = _jspxFactory.getPageContext(this, request, response,
039                            null, true, 5120, false);
040          _jspx_page_context = pageContext;
041          application = pageContext.getServletContext();
042          config = pageContext.getServletConfig();
043          session = pageContext.getSession();
044          out = pageContext.getOut();
045          _jspx_out = out;
046    
047          out.write("<html>\n<!--\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<body bgcolor=\"white\">\n\n<font color=\"red\">\n\n\n\n<p>In place evaluation of another JSP which gives you the current time:\n\n");
048          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<body bgcolor=\"white\">\n<font color=\"red\">\n\n");
049          out.print( System.currentTimeMillis() );
050          out.write('\n');
051          out.write("\n\n<p> ");
052          org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "/include/foo.html", out, true);
053          out.write(" by including the output of another JSP:\n\n");
054          org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "foo.jsp", out, true);
055          out.write("\n\n:-) \n\n</html>\n");
056        } catch (Throwable t) {
057          if (!(t instanceof SkipPageException)){
058            out = _jspx_out;
059            if (out != null && out.getBufferSize() != 0)
060              out.clearBuffer();
061            if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
062          }
063        } finally {
064          if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
065        }
066      }
067    }