001package org.apache.hadoop.hdfs.server.datanode; 002 003import javax.servlet.*; 004import javax.servlet.http.*; 005import javax.servlet.jsp.*; 006import org.apache.hadoop.hdfs.server.common.JspHelper; 007import org.apache.hadoop.util.ServletUtil; 008import org.apache.hadoop.conf.Configuration; 009 010public final class tail_jsp extends org.apache.jasper.runtime.HttpJspBase 011 implements org.apache.jasper.runtime.JspSourceDependent { 012 013 014 //for java.io.Serializable 015 private static final long serialVersionUID = 1L; 016 017 private static java.util.List _jspx_dependants; 018 019 public Object getDependants() { 020 return _jspx_dependants; 021 } 022 023 public void _jspService(HttpServletRequest request, HttpServletResponse response) 024 throws java.io.IOException, ServletException { 025 026 JspFactory _jspxFactory = null; 027 PageContext pageContext = null; 028 HttpSession session = null; 029 ServletContext application = null; 030 ServletConfig config = null; 031 JspWriter out = null; 032 Object page = this; 033 JspWriter _jspx_out = null; 034 PageContext _jspx_page_context = null; 035 036 037 try { 038 _jspxFactory = JspFactory.getDefaultFactory(); 039 response.setContentType("text/html; charset=UTF-8"); 040 pageContext = _jspxFactory.getPageContext(this, request, response, 041 null, true, 8192, true); 042 _jspx_page_context = pageContext; 043 application = pageContext.getServletContext(); 044 config = pageContext.getServletConfig(); 045 session = pageContext.getSession(); 046 out = pageContext.getOut(); 047 _jspx_out = out; 048 049 050/* 051 * Licensed to the Apache Software Foundation (ASF) under one 052 * or more contributor license agreements. See the NOTICE file 053 * distributed with this work for additional information 054 * regarding copyright ownership. The ASF licenses this file 055 * to you under the Apache License, Version 2.0 (the 056 * "License"); you may not use this file except in compliance 057 * with the License. You may obtain a copy of the License at 058 * 059 * http://www.apache.org/licenses/LICENSE-2.0 060 * 061 * Unless required by applicable law or agreed to in writing, software 062 * distributed under the License is distributed on an "AS IS" BASIS, 063 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 064 * See the License for the specific language governing permissions and 065 * limitations under the License. 066 */ 067 068 out.write("<!DOCTYPE html>\n<html>\n<head>\n"); 069JspHelper.createTitle(out, request, request.getParameter("filename")); 070 out.write("</head>\n<body>\n<form action=\"/tail.jsp\" method=\"GET\">\n"); 071 072 Configuration conf = 073 (Configuration) application.getAttribute(JspHelper.CURRENT_CONF); 074 DatanodeJspHelper.generateFileChunksForTail(out,request, conf); 075 076 out.write("</form>\n<hr>\n\n<h2>Local logs</h2>\n<a href=\"/logs/\">Log</a> directory\n\n"); 077 078out.println(ServletUtil.htmlFooter()); 079 080 } catch (Throwable t) { 081 if (!(t instanceof SkipPageException)){ 082 out = _jspx_out; 083 if (out != null && out.getBufferSize() != 0) 084 out.clearBuffer(); 085 if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); 086 } 087 } finally { 088 if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context); 089 } 090 } 091}