Exemple #1
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;

    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write(
          "<!--\n Licensed to Cloudera, Inc. under one\n or more contributor license agreements.  See the NOTICE file\n distributed with this work for additional information\n regarding copyright ownership.  Cloudera, Inc. licenses this file\n to you under the Apache License, Version 2.0 (the\n \"License\"); you may not use this file except in compliance\n with 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<html><head>\n<!-- Copyright (c) 2010 Cloudera, Inc.  All rights reserved. -->\n<!-- Retro web 1.0 flume Agent configuration display -->\n\n<title>Flume Node: ");
      out.print(FlumeNode.getInstance().getPhysicalNodeName());
      out.write(
          " :: Sources and Sinks</title>\n\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/flume.css\" />\n\n</head>\n<body>\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(
          request, response, "menu_agent.jsp", out, false);
      out.write("\n\n<h1>Flume Node: ");
      out.print(FlumeNode.getInstance().getPhysicalNodeName());
      out.write(" :: Extensions - Sink/Source/Decorator</h1>\n\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(
          request, response, "version.jsp", out, false);
      out.write("\n<hr>\n\n\n<div id=\"sinks\">\n<h2>Sinks</h2>\n\n<table>\n\n");

      // treeset so that the list is sorted
      for (String n : new TreeSet<String>(FlumeBuilder.getSinkNames())) {

        out.write("\n    <tr><td>");
        out.print(n);
        out.write("</td></tr>\n");
      }

      out.write("\n\n</table>\n</div>\n\n<div id=\"sources\">\n<h2>Sources</h2>\n<table>\n\n");

      // treeset so that the list is sorted
      for (String n : new TreeSet<String>(FlumeBuilder.getSourceNames())) {

        out.write("\n    <tr><td>");
        out.print(n);
        out.write("</td></tr>\n");
      }

      out.write("\n\n</table>\n</div>\n\n<div id=\"decos\">\n<h2>Decorators</h2>\n<table>\n\n");

      // treeset so that the list is sorted
      for (String n : new TreeSet<String>(FlumeBuilder.getDecoratorNames())) {

        out.write("\n    <tr><td>");
        out.print(n);
        out.write("</td></tr>\n");
      }

      out.write("\n\n</table>\n</div>\n</body></html>\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0) out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
  public void _jspService(
      final javax.servlet.http.HttpServletRequest request,
      final javax.servlet.http.HttpServletResponse response)
      throws java.io.IOException, javax.servlet.ServletException {

    final java.lang.String _jspx_method = request.getMethod();
    if (!"GET".equals(_jspx_method)
        && !"POST".equals(_jspx_method)
        && !"HEAD".equals(_jspx_method)
        && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) {
      response.sendError(
          HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD");
      return;
    }

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;

    try {
      response.setContentType("text/html; charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\n");
      out.write("  \n");
      out.write(" ");
      request.setCharacterEncoding("utf-8");
      out.write('\n');
      out.write(' ');
      movie.admin.filmBean gb = null;
      gb =
          (movie.admin.filmBean)
              _jspx_page_context.getAttribute("gb", javax.servlet.jsp.PageContext.PAGE_SCOPE);
      if (gb == null) {
        gb = new movie.admin.filmBean();
        _jspx_page_context.setAttribute("gb", gb, javax.servlet.jsp.PageContext.PAGE_SCOPE);
      }
      out.write('\n');
      out.write(' ');
      movie.admin.film _film = null;
      _film =
          (movie.admin.film)
              _jspx_page_context.getAttribute("_film", javax.servlet.jsp.PageContext.PAGE_SCOPE);
      if (_film == null) {
        _film = new movie.admin.film();
        _jspx_page_context.setAttribute("_film", _film, javax.servlet.jsp.PageContext.PAGE_SCOPE);
      }
      out.write('\n');
      out.write(' ');
      org.apache.jasper.runtime.JspRuntimeLibrary.introspect(
          _jspx_page_context.findAttribute("_film"), request);
      out.write("\n");
      out.write(" \n");
      out.write("\n");
      out.write(" ");

      String action = request.getParameter("action");

      if (action.equals("list")) {
        ArrayList<film> films = gb.getDBlist();
        request.setAttribute("datas", films);
        pageContext.forward("admin_mode.jsp");
      }
      if (action.equals("back")) {
        ArrayList<film> films = gb.getDBlist();
        request.setAttribute("datas", films);
        pageContext.forward("admin_mode.jsp");
      } else if (action.equals("insert")) {
        if (gb.insertDB(_film)) {
          response.sendRedirect("film_control.jsp?action=list");
        } else throw new Exception("DB 입력 오류");
      } else if (action.equals("delete")) {

        if (gb.deleteDB(_film.getId_film())) {
          response.sendRedirect("film_control.jsp?action=list");
        } else throw new Exception("DB 삭제 오류");
      }
      // else if(action.equals("update")){
      // }
      else {
      }

      out.write("\n");
      out.write("    \n");
      out.write(
          "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n");
      out.write("<html>\n");
      out.write("<head>\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n");
      out.write("<title>Insert title here</title>\n");
      out.write("</head>\n");
      out.write("<body>\n");
      out.write("\n");
      out.write("</body>\n");
      out.write("</html>");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              out.clearBuffer();
            }
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }