Пример #1
0
  // callRestfulApi - Calls restful API and returns results as a string
  public String callRestfulApi(
      String addr, HttpServletRequest request, HttpServletResponse response) {
    if (localCookie) CookieHandler.setDefault(cm);

    try {
      ByteArrayOutputStream output = new ByteArrayOutputStream();
      URL url = new URL(API_ROOT + addr);
      URLConnection urlConnection = url.openConnection();
      String cookieVal = getBrowserInfiniteCookie(request);
      if (cookieVal != null) {
        urlConnection.addRequestProperty("Cookie", "infinitecookie=" + cookieVal);
        urlConnection.setDoInput(true);
        urlConnection.setDoOutput(true);
        urlConnection.setRequestProperty("Accept-Charset", "UTF-8");
      }
      IOUtils.copy(urlConnection.getInputStream(), output);
      String newCookie = getConnectionInfiniteCookie(urlConnection);
      if (newCookie != null && response != null) {
        setBrowserInfiniteCookie(response, newCookie, request.getServerPort());
      }
      return output.toString();
    } catch (IOException e) {
      System.out.println(e.getMessage());
      return null;
    }
  } // TESTED
Пример #2
0
  // postToRestfulApi -
  // Note: params in the addr field need to be URLEncoded
  private String postToRestfulApi(
      String addr, String data, HttpServletRequest request, HttpServletResponse response) {
    if (localCookie) CookieHandler.setDefault(cm);
    String result = "";
    try {
      URLConnection connection = new URL(API_ROOT + addr).openConnection();
      String cookieVal = getBrowserInfiniteCookie(request);
      if (cookieVal != null) {
        connection.addRequestProperty("Cookie", "infinitecookie=" + cookieVal);
        connection.setDoInput(true);
      }
      connection.setDoOutput(true);
      connection.setRequestProperty("Accept-Charset", "UTF-8");

      // Post JSON string to URL
      OutputStream os = connection.getOutputStream();
      byte[] b = data.getBytes("UTF-8");
      os.write(b);

      // Receive results back from API
      InputStream is = connection.getInputStream();
      result = IOUtils.toString(is, "UTF-8");

      String newCookie = getConnectionInfiniteCookie(connection);
      if (newCookie != null && response != null) {
        setBrowserInfiniteCookie(response, newCookie, request.getServerPort());
      }
    } catch (Exception e) {
      // System.out.println("Exception: " + e.getMessage());
    }
    return result;
  } // TESTED
Пример #3
0
  public synchronized void service(HttpServletRequest request, HttpServletResponse response)
      throws IOException, ServletException {
    HttpSession dbSession = request.getSession();
    JspFactory _jspxFactory = JspFactory.getDefaultFactory();
    PageContext pageContext =
        _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
    ServletContext dbApplication = dbSession.getServletContext();

    ServletContext application;
    HttpSession session = request.getSession();
    nseer_db_backup1 finance_db = new nseer_db_backup1(dbApplication);

    try {

      if (finance_db.conn((String) dbSession.getAttribute("unit_db_name"))) {
        String finance_cheque_id = request.getParameter("finance_cheque_id");
        String sql = "delete from finance_bill where id='" + finance_cheque_id + "'";
        finance_db.executeUpdate(sql);
        finance_db.commit();
        finance_db.close();

      } else {
        response.sendRedirect("error_conn.htm");
      }
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
Пример #4
0
  public String getAbsolutePath(String url) {
    int pos;
    if (url == null) return null;
    if (url.startsWith("/")) return url;
    HttpServletRequest request = (HttpServletRequest) (pageContext.getRequest());

    pos = request.getServletPath().lastIndexOf("/");
    return request.getServletPath().substring(0, pos + 1) + url;
  }
Пример #5
0
 // getBrowserInfiniteCookie
 public static String getBrowserInfiniteCookie(HttpServletRequest request) {
   Cookie[] cookieJar = request.getCookies();
   if (cookieJar != null) {
     for (Cookie cookie : cookieJar) {
       if (cookie.getName().equals("infinitecookie")) {
         return cookie.getValue() + ";";
       }
     }
   }
   return null;
 } // TESTED
Пример #6
0
 public String getClientIPAddr() {
   HttpServletRequest request = (HttpServletRequest) (pageContext.getRequest());
   String remoteAddr = request.getRemoteAddr();
   String x;
   if ((x = request.getHeader("X-FORWARDED-FOR")) != null) {
     remoteAddr = x;
     int idx = remoteAddr.indexOf(',');
     if (idx > -1) {
       remoteAddr = remoteAddr.substring(0, idx);
     }
   }
   return remoteAddr;
 }
Пример #7
0
  public synchronized void service(HttpServletRequest request, HttpServletResponse response)
      throws IOException, ServletException {
    HttpSession dbSession = request.getSession();
    JspFactory _jspxFactory = JspFactory.getDefaultFactory();
    PageContext pageContext =
        _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
    ServletContext dbApplication = dbSession.getServletContext();

    try {
      HttpSession session = request.getSession();
      PrintWriter out = response.getWriter();
      MakePdf mm = new MakePdf();
      excel query = new excel();
      getKeyColumn column = new getKeyColumn();
      mm.setConfigFile("xml/stock/pdf_export.xml");
      String sql = "";
      String tablename = request.getParameter("tablename");
      String condition = "";
      String queue = "";
      if (tablename.equals("stock_balance")) {
        queue = "order by chain_ID";
        condition = "where address_group!=''";
      }
      sql = "select * from " + tablename + " " + condition + " " + queue;
      int a = sql.indexOf("*");
      String sqla = sql.substring(0, a) + "count(*) as A" + sql.substring(a + 1, sql.length());

      mm.make(
          (String) dbSession.getAttribute("unit_db_name"),
          tablename,
          sqla,
          sql,
          "pdf_files/stock_data",
          1500,
          session);
      int fileAmount = mm.fileAmount();
      response.sendRedirect("stock/export/pdf_ok_a.jsp?file_amount=" + fileAmount + "");

    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
Пример #8
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    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 {
      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;
      _jspx_resourceInjector =
          (org.apache.jasper.runtime.ResourceInjector)
              application.getAttribute("com.sun.appserv.jsp.resource.injector");

      out.write('\n');
      out.write('\n');
      out.write("\n<!DOCTYPE html>\n<html>\n<head>\n");
      JspHelper.createTitle(out, request, request.getParameter("filename"));
      out.write("\n</head>\n<body onload=\"document.goto.dir.focus()\">\n");

      Configuration conf = (Configuration) getServletContext().getAttribute(JspHelper.CURRENT_CONF);
      generateFileChunks(out, request, conf);

      out.write("\n<hr>\n");

      generateFileDetails(out, request, conf);

      out.write("\n\n<h2>Local logs</h2>\n<a href=\"/logs/\">Log</a> directory\n\n");

      out.println(ServletUtil.htmlFooter());

      out.write('\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 {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
Пример #9
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    response.setContentType("text/html;charset=windows-1252");
    /* set up the intrinsic variables using the pageContext goober:
     ** session = HttpSession
     ** application = ServletContext
     ** out = JspWriter
     ** page = this
     ** config = ServletConfig
     ** all session/app beans declared in globals.jsa
     */
    PageContext pageContext =
        JspFactory.getDefaultFactory()
            .getPageContext(this, request, response, null, true, JspWriter.DEFAULT_BUFFER, true);
    // Note: this is not emitted if the session directive == false
    HttpSession session = pageContext.getSession();
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE)
        != null) {
      pageContext.setAttribute(
          OracleJspRuntime.JSP_PAGE_DONTNOTIFY, "true", PageContext.PAGE_SCOPE);
      JspFactory.getDefaultFactory().releasePageContext(pageContext);
      return;
    }
    int __jsp_tag_starteval;
    ServletContext application = pageContext.getServletContext();
    JspWriter out = pageContext.getOut();
    _mainMib page = this;
    ServletConfig config = pageContext.getServletConfig();

    try {
      // global beans
      // end global beans

      /*@lineinfo:user-code*/
      /*@lineinfo:1^1*/
      session.setAttribute("ip", request.getParameter("ip"));

      /*@lineinfo:generated-code*/
      out.write(__oracle_jsp_text[0]);

    } catch (Throwable e) {
      try {
        if (out != null) out.clear();
      } catch (Exception clearException) {
      }
      pageContext.handlePageException(e);
    } finally {
      OracleJspRuntime.extraHandlePCFinally(pageContext, false);
      JspFactory.getDefaultFactory().releasePageContext(pageContext);
    }
  }
Пример #10
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');
      out.write('\n');
      out.write("\n\n\n\n<html>\n<head>\n");
      JspHelper.createTitle(out, request, request.getParameter("filename"));
      out.write("\n</head>\n<body>\n<form action=\"/tail.jsp\" method=\"GET\">\n");

      generateFileChunks(out, request);

      out.write("\n</form>\n<hr>\n\n<h2>Local logs</h2>\n<a href=\"/logs/\">Log</a> directory\n\n");

      out.println(ServletUtil.htmlFooter());

      out.write('\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(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    javax.servlet.jsp.PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;

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

      out.write("\n");
      out.write("\n");

      HttpSession user = request.getSession(true);
      Notification newNotice = (Notification) user.getAttribute("newNotice");
      List exclude = new ArrayList();
      exclude.add(NotificationWizardServlet.WT_VENDOR_NAME); // Exclude WebTelemetry

      out.print(buildTree(newNotice, exclude));
      out.write("\n");
    } catch (Throwable t) {
      out = _jspx_out;
      if (out != null && out.getBufferSize() != 0) out.clearBuffer();
      if (pageContext != null) pageContext.handlePageException(t);
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
    }
  }
Пример #12
0
  public synchronized void service(HttpServletRequest request, HttpServletResponse response)
      throws IOException, ServletException {
    HttpSession dbSession = request.getSession();
    JspFactory _jspxFactory = JspFactory.getDefaultFactory();
    PageContext pageContext =
        _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
    ServletContext dbApplication = dbSession.getServletContext();

    nseer_db_backup1 stock_db = new nseer_db_backup1(dbApplication);

    try {
      if (stock_db.conn((String) dbSession.getAttribute("unit_db_name"))) {
        int i;
        int intRowCount;
        String sqll =
            "select * from stock_config_public_char where describe1='\u51fa\u5165\u5e93\u7406\u7531'";
        ResultSet rs = stock_db.executeQuery(sqll);
        rs.next();
        rs.last();
        intRowCount = rs.getRow();
        String[] del = new String[intRowCount];
        del = (String[]) dbSession.getAttribute("del");
        if (del != null) {
          for (i = 1; i <= intRowCount; i++) {
            String sql = "delete from stock_config_public_char where id='" + del[i - 1] + "'";
            stock_db.executeUpdate(sql);
          }
        }
        stock_db.commit();
        stock_db.close();
        response.sendRedirect("stock/config/apply_gather_pay/reason.jsp");
      } else {
        response.sendRedirect("error_conn.htm");
      }
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
Пример #13
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    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 {
      response.setContentType("text/html");
      response.setHeader("X-Powered-By", "JSP/2.2");
      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;
      _jspx_resourceInjector =
          (org.glassfish.jsp.api.ResourceInjector)
              application.getAttribute("com.sun.appserv.jsp.resource.injector");

      response.sendRedirect(request.getContextPath() + "/main");
    } 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);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
  public int doStartTag() throws JspException {
    try {
      HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
      ModuleContext context = (ModuleContext) request.getSession().getAttribute("context");

      String viewObject = request.getParameter("viewObject");
      viewObject = (viewObject == null || viewObject.equals("")) ? "xava_view" : viewObject;
      View view = (View) context.get(request, viewObject);

      MetaReference metaReference = view.getMetaReference(reference).cloneMetaReference();
      metaReference.setName(reference);
      String prefix = request.getParameter("propertyPrefix");
      prefix = prefix == null ? "" : prefix;
      String application = request.getParameter("application");
      String module = request.getParameter("module");
      String referenceKey = Ids.decorate(application, module, prefix + reference);
      request.setAttribute(referenceKey, metaReference);
      String editorURL =
          "reference.jsp?referenceKey="
              + referenceKey
              + "&onlyEditor=true&frame=false&composite=false&descriptionsList=true";
      String editorPrefix = Module.isPortlet() ? "/WEB-INF/jsp/xava/" : "/xava/";
      try {
        pageContext.include(editorPrefix + editorURL);
      } catch (ServletException ex) {
        Throwable cause = ex.getRootCause() == null ? ex : ex.getRootCause();
        log.error(cause.getMessage(), cause);
        pageContext.include(editorPrefix + "editors/notAvailableEditor.jsp");
      } catch (Exception ex) {
        log.error(ex.getMessage(), ex);
        pageContext.include(editorPrefix + "editors/notAvailableEditor.jsp");
      }
    } catch (Exception ex) {
      log.error(ex.getMessage(), ex);
      throw new JspException(XavaResources.getString("descriptionsList_tag_error", reference));
    }
    return SKIP_BODY;
  }
  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");
      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;

      /*
       * Copyright 2006 Pentaho Corporation.  All rights reserved.
       * This software was developed by Pentaho Corporation and is provided under the terms
       * of the Mozilla Public License, Version 1.1, or any later version. You may not use
       * this file except in compliance with the license. If you need a copy of the license,
       * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
       * BI Platform.  The Initial Developer is Pentaho Corporation.
       *
       * Software distributed under the Mozilla Public License is distributed on an "AS IS"
       * basis, WITHOUT WARRANTY OF ANY KIND, either express or  implied. Please refer to
       * the license for the specific language governing your rights and limitations.
       *
       * Created Feb 16, 2006
       * @author James Dixon  modified by Kurtis Cruzada
       */

      /*
       * This JSP is an example of how to use Pentaho components to build a dashboard.
       * The script in this file controls the layout and content generation of the dashboard.
       * See the document 'Dashboard Builder Guide' for more details
       */

      // set the character encoding e.g. UFT-8
      response.setCharacterEncoding(LocaleHelper.getSystemEncoding());

      // create a new Pentaho session
      IPentahoSession userSession = PentahoHttpSessionHelper.getPentahoSession(request);

      out.write("\t\r\n");
      out.write("\t");

      // See if we have a 'territory' parameter
      String territory = request.getParameter("territory");
      // See if we have a 'productline' parameter
      String productline = request.getParameter("productline");

      // Create the title for the top of the page
      String title = "Revenue Analysis";
      if (productline != null) {
        title = "Sales for " + territory + ", " + productline;
      } else if (territory != null) {
        title = "Sales for " + territory;
      }

      out.write("\r\n");
      out.write("\t<html>\n");
      out.write("\t<head>\r\n");
      out.write("\t\t<title>Steel Wheels - Revenue Analysis</title>\r\n");
      out.write("\t</head>\r\n");
      out.write("\t<body>\r\n");
      out.write("  \t<table  background=\"/sw-style/active/logo_backup.png\">\n");
      out.write("  \t\t<tr>\r\n");
      out.write(
          "  \t\t\t<td width=\"750\" height=\"40\" align=\"right\" valign=\"middle\" style=\"font-family:Arial;font-weight:bold\" border=\"0\"/>");
      out.print(title);
      out.write("</td>\n");
      out.write("  \t\t</tr>\t\t\n");
      out.write("  \t</table>\t\r\n");
      out.write(
          "  \t<table class=\"homeDashboard\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" >\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td valign=\"top\" align=\"center\">\r\n");
      out.write("\t");

      // Make a pie chart showing the territories
      // create the parameres for the pie chart
      SimpleParameterProvider parameters = new SimpleParameterProvider();
      // define the click url template
      parameters.setParameter("drill-url", "SWDashboard?territory={TERRITORY}");
      // define the slices of the pie chart
      parameters.setParameter("inner-param", "TERRITORY"); // $NON-NLS-1$ //$NON-NLS-2$
      // set the width and the height
      parameters.setParameter("image-width", "350"); // $NON-NLS-1$ //$NON-NLS-2$
      parameters.setParameter("image-height", "200"); // $NON-NLS-1$ //$NON-NLS-2$
      StringBuffer content = new StringBuffer();
      ArrayList messages = new ArrayList();
      // call the chart helper to generate the pie chart image and to get the HTML content
      // use the chart definition in 'steel-wheels/dashboard/territory.widget.xml'
      ChartHelper.doPieChart(
          "steel-wheels",
          "dashboards",
          "territory.widget.xml",
          parameters,
          content,
          userSession,
          messages,
          null);

      out.write("\r\n");
      out.write("\t\t");
      out.print(content.toString());
      out.write("\r\n");
      out.write("\t\t</td>\t\t\t\r\n");
      out.write("\t\t<td valign=\"top\" align=\"center\">\r\n");
      out.write("\t");

      if (territory == null) {
        // if the user has clicked on a slice of the pie chart we should have a territory to work
        // with

        out.write("\t\t\t\r\n");
        out.write("\t");

        // Make a bar chart showing the department
        // create the parameres for the bar chart
        parameters = new SimpleParameterProvider();
        // define the click url template
        parameters.setParameter(
            "drill-url", "SWDashboard?territory=" + territory + "&amp;productline={SERIES}");
        parameters.setParameter("TERRITORY", territory);
        parameters.setParameter("outer-params", "TERRITORY");
        // define the category axis of the bar chart
        parameters.setParameter("inner-param", "TERRITORY"); // $NON-NLS-1$ //$NON-NLS-2$
        parameters.setParameter("inner-param", "PRODUCTLINE"); // $NON-NLS-1$ //$NON-NLS-2$
        // set the width and the height
        parameters.setParameter("image-width", "400"); // $NON-NLS-1$ //$NON-NLS-2$
        parameters.setParameter("image-height", "200"); // $NON-NLS-1$ //$NON-NLS-2$
        content = new StringBuffer();
        messages = new ArrayList();
        // call the chart helper to generate the pie chart image and to get the HTML content
        // use the chart definition in 'steel-wheels/dashboard/productline.widget.xml'
        ChartHelper.doChart(
            "steel-wheels",
            "dashboards",
            "productline_all.widget.xml",
            parameters,
            content,
            userSession,
            messages,
            null);

        out.write("\t\t\r\n");
        out.write("\t\t");
        out.print(content.toString());
        out.write("\r\n");
        out.write("\t\t");
      }

      out.write('\r');
      out.write('\n');
      out.write('	');

      if (territory != null) {
        // if the user has clicked on a slice of the pie chart we should have a territory to work
        // with

        out.write("\t\t\t\r\n");
        out.write("\t");

        // Make a bar chart showing the department
        // create the parameres for the bar chart
        parameters = new SimpleParameterProvider();
        // define the click url template
        parameters.setParameter(
            "drill-url", "SWDashboard?territory=" + territory + "&amp;productline={SERIES}");
        parameters.setParameter("TERRITORY", territory);
        parameters.setParameter("outer-params", "TERRITORY");
        // define the category axis of the bar chart
        parameters.setParameter("inner-param", "TERRITORY"); // $NON-NLS-1$ //$NON-NLS-2$
        parameters.setParameter("inner-param", "PRODUCTLINE"); // $NON-NLS-1$ //$NON-NLS-2$
        // set the width and the height
        parameters.setParameter("image-width", "400"); // $NON-NLS-1$ //$NON-NLS-2$
        parameters.setParameter("image-height", "200"); // $NON-NLS-1$ //$NON-NLS-2$
        content = new StringBuffer();
        messages = new ArrayList();
        // call the chart helper to generate the pie chart image and to get the HTML content
        // use the chart definition in 'steel-wheels/dashboard/productline.widget.xml'
        ChartHelper.doChart(
            "steel-wheels",
            "dashboards",
            "productline.widget.xml",
            parameters,
            content,
            userSession,
            messages,
            null);

        out.write("\r\n");
        out.write("\t\t\t");
        out.print(content.toString());
        out.write('\r');
        out.write('\n');
        out.write('	');
      }

      out.write("\r\n");
      out.write("\t\t</td>\r\n");
      out.write("\t</tr> \t\r\n");
      out.write("    </table>\n");
      out.write(
          "  \t<table class=\"homeDashboard\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" >\n");
      out.write("  \t<tr>\r\n");
      out.write("  \t\t<td valign=\"top\" align=\"center\"> \t  \t\t\t\t\r\n");
      out.write("  \t");

      if (productline != null) {

        // if the user has clicked on a bar of the bar chart we should have a territory and
        // productline to work with

        // create a dial and supply a value we create from the current time
        // create the parameters for the line chart
        parameters = new SimpleParameterProvider();
        parameters.setParameter("TERRITORY", territory);
        parameters.setParameter("outer-params", "TERRITORY");
        parameters.setParameter("PRODUCTLINE", productline);
        parameters.setParameter("outer-params", "PRODUCTLINE");
        // define the category axis of the bar chart
        parameters.setParameter("inner-param", "PRODUCTLINE"); // $NON-NLS-1$ //$NON-NLS-2$
        // set the width and the height
        parameters.setParameter("image-width", "750"); // $NON-NLS-1$ //$NON-NLS-2$
        parameters.setParameter("image-height", "200"); // $NON-NLS-1$ //$NON-NLS-2$
        content = new StringBuffer();
        messages = new ArrayList();
        // call the chart helper to generate the pie chart image and to get the HTML content
        // use the chart definition in 'steel-wheels/dashboard/regions.widget.xml'
        ChartHelper.doChart(
            "steel-wheels",
            "dashboards",
            "SalesOvertime.widget.xml",
            parameters,
            content,
            userSession,
            messages,
            null);

        out.write("\r\n");
        out.write("  \t");
        out.print(content.toString());
        out.write("\r\n");
        out.write("  \t");
      }

      out.write("\r\n");
      out.write(" \t");

      if (productline == null) {
        // if the user has clicked on a bar of the bar chart we should have a territory and
        // productline to work with
        // create a dial and supply a value we create from the current time
        // create the parameters for the line chart
        parameters = new SimpleParameterProvider();
        parameters.setParameter("TERRITORY", territory);
        parameters.setParameter("outer-params", "TERRITORY");
        // define the category axis of the bar chart
        parameters.setParameter("inner-param", "PRODUCTLINE"); // $NON-NLS-1$ //$NON-NLS-2$
        // set the width and the height
        parameters.setParameter("image-width", "750"); // $NON-NLS-1$ //$NON-NLS-2$
        parameters.setParameter("image-height", "200"); // $NON-NLS-1$ //$NON-NLS-2$
        content = new StringBuffer();
        messages = new ArrayList();
        // call the chart helper to generate the pie chart image and to get the HTML content
        // use the chart definition in 'steel-wheels/dashboard/regions.widget.xml'
        ChartHelper.doChart(
            "steel-wheels",
            "dashboards",
            "SalesOvertime_All.widget.xml",
            parameters,
            content,
            userSession,
            messages,
            null);

        out.write("  \t\t\r\n");
        out.write("  \t\t");
        out.print(content.toString());
        out.write("\r\n");
        out.write("  \t");
      }

      out.write("\t\r\n");
      out.write("  \t\t</td>\r\n");
      out.write("  \t</tr>\r\n");
      out.write("  </table>\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\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(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    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 {
      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('\r');
      out.write('\n');
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");

      String path = request.getContextPath();
      String basePath =
          request.getScheme()
              + "://"
              + request.getServerName()
              + ":"
              + request.getServerPort()
              + path;

      out.write('\r');
      out.write('\n');
      //  c:set
      org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_005fset_005f0 =
          (org.apache.taglibs.standard.tag.rt.core.SetTag)
              _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.get(
                  org.apache.taglibs.standard.tag.rt.core.SetTag.class);
      _jspx_th_c_005fset_005f0.setPageContext(_jspx_page_context);
      _jspx_th_c_005fset_005f0.setParent(null);
      // /context/mytags.jsp(9,0) name = var type = java.lang.String reqTime = false required =
      // false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false
      // methodSignature = null
      _jspx_th_c_005fset_005f0.setVar("webRoot");
      // /context/mytags.jsp(9,0) name = value type = javax.el.ValueExpression reqTime = true
      // required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object
      // deferredMethod = false methodSignature = null
      _jspx_th_c_005fset_005f0.setValue(basePath);
      int _jspx_eval_c_005fset_005f0 = _jspx_th_c_005fset_005f0.doStartTag();
      if (_jspx_th_c_005fset_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
        _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(
            _jspx_th_c_005fset_005f0);
        return;
      }
      _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(
          _jspx_th_c_005fset_005f0);
      out.write("\r\n");
      out.write("<script type=\"text/javascript\">\r\n");
      out.write("\t$('#addBtn').linkbutton({   \r\n");
      out.write("\t    iconCls: 'icon-add'  \r\n");
      out.write("\t});  \r\n");
      out.write("\t$('#delBtn').linkbutton({   \r\n");
      out.write("\t    iconCls: 'icon-remove'  \r\n");
      out.write("\t}); \r\n");
      out.write("\t$('#addBtn').bind('click', function(){   \r\n");
      out.write(" \t\t var tr =  $(\"#add_jeecgOrderProduct_table_template tr\").clone();\r\n");
      out.write("\t \t $(\"#add_jeecgOrderProduct_table\").append(tr);\r\n");
      out.write("\t \t resetTrNum('add_jeecgOrderProduct_table');\r\n");
      out.write("    });  \r\n");
      out.write("\t$('#delBtn').bind('click', function(){   \r\n");
      out.write(
          "       $(\"#add_jeecgOrderProduct_table\").find(\"input:checked\").parent().parent().remove();   \r\n");
      out.write("        resetTrNum('add_jeecgOrderProduct_table');\r\n");
      out.write("    });\r\n");
      out.write("\t$(document).ready(function(){\r\n");
      out.write("\t\t$(\".datagrid-toolbar\").parent().css(\"width\",\"auto\");\r\n");
      out.write("\t\t//将表格的表头固定\r\n");
      out.write("\t    $(\"#jeecgOrderProduct_table\").createhftable({\r\n");
      out.write("\t    \theight:'200px',\r\n");
      out.write("\t\t\twidth:'auto',\r\n");
      out.write("\t\t\tfixFooter:false\r\n");
      out.write("\t\t\t});\r\n");
      out.write("});\r\n");
      out.write("</script>\r\n");
      out.write("\r\n");
      out.write(
          "<div style=\"padding: 3px; height: 25px; width: width: 900px;\" class=\"datagrid-toolbar\"><a id=\"addBtn\" href=\"#\">添加</a> <a id=\"delBtn\" href=\"#\">删除</a></div>\r\n");
      out.write(
          "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" id=\"jeecgOrderProduct_table\">\r\n");
      out.write("\t<tr bgcolor=\"#E6E6E6\">\r\n");
      out.write("\t\t<td align=\"center\" bgcolor=\"#EEEEEE\">序号</td>\r\n");
      out.write("\t\t<td align=\"left\" bgcolor=\"#EEEEEE\">产品名称</td>\r\n");
      out.write("\t\t<td align=\"left\" bgcolor=\"#EEEEEE\">个数</td>\r\n");
      out.write("\t\t<td align=\"left\" bgcolor=\"#EEEEEE\">服务项目类型</td>\r\n");
      out.write("\t\t<td align=\"left\" bgcolor=\"#EEEEEE\">单价</td>\r\n");
      out.write("\t\t<td align=\"left\" bgcolor=\"#EEEEEE\">小计</td>\r\n");
      out.write("\t\t<td align=\"left\" bgcolor=\"#EEEEEE\">备注</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("\t<tbody id=\"add_jeecgOrderProduct_table\">\r\n");
      out.write("\t\t");
      if (_jspx_meth_c_005fif_005f0(_jspx_page_context)) return;
      out.write("\r\n");
      out.write("\t\t");
      if (_jspx_meth_c_005fif_005f1(_jspx_page_context)) return;
      out.write("\r\n");
      out.write("\t</tbody>\r\n");
      out.write("</table>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else log(t.getMessage(), t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
  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");
      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\n\n\n\n\n\n\n");

      boolean bookmarkCreated = request.getParameter("bookmarkCreated") != null;

      boolean delete = request.getParameter("delete") != null;
      final Collection<Bookmark> bookmarks = BookmarkManager.getBookmarks();

      out.write("\n\n<html>\n<head>\n    <title>");
      if (_jspx_meth_fmt_message_0(_jspx_page_context)) return;
      out.write(
          "</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/style/global.css\">\n    <meta name=\"pageID\" content=\"groupchat-bookmarks\"/>\n    <script src=\"/js/prototype.js\" type=\"text/javascript\"></script>\n    <script src=\"/js/scriptaculous.js\" type=\"text/javascript\"></script>\n    <style type=\"text/css\">\n        .div-border {\n            border: 1px solid #CCCCCC;\n            -moz-border-radius: 3px;\n        }\n    </style>\n    <style type=\"text/css\">\n        @import \"style/style.css\";\n    </style>\n</head>\n\n<body>\n\n<p>\n    ");
      if (_jspx_meth_fmt_message_1(_jspx_page_context)) return;
      out.write("\n</p>\n\n");
      if (bookmarkCreated) {
        out.write("\n<div class=\"success\">\n   ");
        if (_jspx_meth_fmt_message_2(_jspx_page_context)) return;
        out.write("\n</div>\n");
      }
      out.write('\n');
      out.write('\n');
      if (delete) {
        out.write("\n<div class=\"success\">\n     ");
        if (_jspx_meth_fmt_message_3(_jspx_page_context)) return;
        out.write("\n</div>\n");
      }
      out.write(
          "\n\n<br/>\n\n    <div class=\"div-border\" style=\"padding: 12px; width: 95%;\">\n        <table class=\"jive-table\" cellspacing=\"0\" width=\"100%\">\n            <th>");
      if (_jspx_meth_fmt_message_4(_jspx_page_context)) return;
      out.write("</th><th>");
      if (_jspx_meth_fmt_message_5(_jspx_page_context)) return;
      out.write("</th><th>");
      if (_jspx_meth_fmt_message_6(_jspx_page_context)) return;
      out.write("</th><th>");
      if (_jspx_meth_fmt_message_7(_jspx_page_context)) return;
      out.write("</th><th>");
      if (_jspx_meth_fmt_message_8(_jspx_page_context)) return;
      out.write("</th><th>");
      if (_jspx_meth_fmt_message_9(_jspx_page_context)) return;
      out.write("</th>\n            ");

      boolean hasBookmarks = false;
      for (Bookmark bookmark : bookmarks) {
        String users = "";
        String groups = "";
        if (bookmark.getType() != Bookmark.Type.group_chat) {
          continue;
        } else {
          hasBookmarks = true;
          if (bookmark.isGlobalBookmark()) {
            users = "All";
            groups = "All";
          } else {
            users =
                bookmark.getUsers().size()
                    + " "
                    + LocaleUtils.getLocalizedString("group.chat.bookmark.users", "clientcontrol");
            groups =
                bookmark.getGroups().size()
                    + " "
                    + LocaleUtils.getLocalizedString("group.chat.bookmark.groups", "clientcontrol");
          }
        }

        out.write("\n            <tr style=\"border-left: none;\">\n                <td>");
        out.print(bookmark.getName());
        out.write("</td>\n                <td>");
        out.print(bookmark.getValue());
        out.write("</td>\n                <td>");
        out.print(users);
        out.write("</td>\n                <td>");
        out.print(groups);
        out.write("</td>\n                <td>");
        out.print(
            bookmark.getProperty("autojoin") != null ? "<img src='/images/check.gif'>" : "&nbsp;");
        out.write(
            "</td>\n                <td>\n                    <a href=\"create-bookmark.jsp?edit=true&bookmarkID=");
        out.print(bookmark.getBookmarkID());
        out.write(
            "\"><img src=\"/images/edit-16x16.gif\" border=\"0\" width=\"16\" height=\"16\" alt=\"Edit Bookmark\"/></a>\n                    <a href=\"confirm-bookmark-delete.jsp?bookmarkID=");
        out.print(bookmark.getBookmarkID());
        out.write(
            "\"><img src=\"/images/delete-16x16.gif\" border=\"0\" width=\"16\" height=\"16\" alt=\"Delete Bookmark\"/></a>\n\n                </td>\n            </tr>\n            ");
      }
      out.write("\n\n            ");
      if (!hasBookmarks) {
        out.write("\n            <tr>\n                <td colspan=\"6\" align=\"center\">");
        if (_jspx_meth_fmt_message_10(_jspx_page_context)) return;
        out.write("</td>\n            </tr>\n            ");
      }
      out.write(
          "\n            <tr>\n                <td colspan=\"6\">\n                    <a href=\"create-bookmark.jsp?type=group_chat\"><img src=\"/images/add-16x16.gif\" border=\"0\" align=\"texttop\" style=\"margin-right: 3px;\"/>");
      if (_jspx_meth_fmt_message_11(_jspx_page_context)) return;
      out.write(
          "</a>\n                </td>\n            </tr>\n        </table>\n    </div>\n\n</body>\n</html>\n\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);
    }
  }
Пример #18
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    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 {
      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("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
      out.write("<html>\n");
      out.write("<head>\n");
      out.write("<title>\n");
      out.write("Section 1\n");
      out.write("</title>\n");
      out.write("<style type=\"text/css\">\n");
      out.write("<!--\n");
      out.write(
          ".normalfont {font-size: 11pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\";}\n");
      out.write(
          ".bigfont {font-size: 14pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\";}\n");
      out.write(
          ".bigbigfont {font-size: 16pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\";}\n");
      out.write(
          ".darkbackgroundwithnormalfont {background-image: url(../gifs/brushed_metal_dkblue.jpg); font-size: 11pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\"; color: black; }\n");
      out.write(
          ".darkbackgroundwithhugefont {background-image: url(../gifs/brushed_metal_dkblue.jpg); font-size: 15pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\"; color: black; }\n");
      out.write(
          ".normalfontwithred {font-size: 11pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\"; color: red;}\n");
      out.write(".centertable {text-align: center; vertical-align: middle;}\n");
      out.write("a {text-decoration: none;}\n");
      out.write(
          ".headerfont {font-size: 18pt; font-family: \"Geneva, Arial, Helvetica, sans-serif\";}\n");
      out.write("button, button:focus, button:active {\n");
      out.write("    /* NOTE Remove all decorations */\n");
      out.write("    border: none;\n");
      out.write("    display: inline;\n");
      out.write("    margin: 0em;\n");
      out.write("    padding: 0em;\n");
      out.write("    outline: none;\n");
      out.write("    outline-offset: 0em;\n");
      out.write("    /* NOTE Look like a link */\n");
      out.write("    background: none;\n");
      out.write("    color: blue;\n");
      out.write("    cursor: pointer;\n");
      out.write("    font: inherit;\n");
      out.write("    text-decoration: none;\n");
      out.write("}\n");
      out.write("-->\n");
      out.write("</style>\n");
      out.write("</head>\n");
      out.write("<!-- bgcolor=\"aqua\" -->\n");
      out.write(
          "<body class=\"bodybackground\" style=\"margin-top: 0; margin-left: 0; margin-bottom: 4px; margin-right: 4px\">\n");
      out.write(
          "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"875px\" style=\"height: 100%\">\n");
      out.write("<tr valign=\"top\">\n");
      out.write("<td style=\"width: 190px;\" class=\"marginbackground\">\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      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(
          "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" class=\"normalfont\" style=\"height: 100%\" >\n");
      out.write("<tr style=\"height: 61px; border-bottom-width: 0px; \" valign=\"top\">\n");
      out.write("<td>\n");
      out.write("\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("<tr style=\"height: 10px;\">\n");
      out.write("<td>\n");
      out.write("&nbsp;\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("\n");
      out.write("<tr class=\"darkbackgroundwithnormalfont\" style=\"height: 20px;\">\n");
      out.write("<td align=\"center\">\n");
      out.write("<b>\n");
      String e = (String) request.getSession().getAttribute("name");
      out.println(e);
      out.write("\n");
      out.write("</b>\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("<tr style=\"height: 10px;\">\n");
      out.write("<td>\n");
      out.write("&nbsp;\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("\n");
      out.write("<tr style=\"height: 35px;\">\n");
      out.write("<td>\n");
      out.write("&nbsp;&nbsp;&nbsp;&nbsp;&#8226;&nbsp;\n");
      out.write("<a href=\"loginpath?id=professor_home_link\" style=\"color: darkblue;\">\n");
      out.write("Home Page\n");
      out.write("</a>\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("\n");
      out.write("<tr style=\"height: 35px;\">\n");
      out.write("<td>\n");
      out.write("&nbsp;&nbsp;&nbsp;&nbsp;&#8226;&nbsp;\n");
      out.write("<a href=\"professor_welcome_path?id=sections\" style=\"color: darkblue;\">\n");
      out.write("Sections\n");
      out.write("</a>\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("\n");
      out.write("<tr style=\"height: 35px;\">\n");
      out.write("<td>\n");
      out.write("&nbsp;&nbsp;&nbsp;&nbsp;&#8226;&nbsp;\n");
      out.write("<a href=\"professor_welcome_path?id=assignments\" style=\"color: darkblue;\">\n");
      out.write("Assignments\n");
      out.write("</a>\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("\n");
      out.write("<tr style=\"height: 35px;\">\n");
      out.write("<td>\n");
      out.write("&nbsp;&nbsp;&nbsp;&nbsp;&#8226;&nbsp;\n");
      out.write("<a href=\"prof_account_settings.jsp\" style=\"color: darkblue;\">\n");
      out.write("Account Settings\n");
      out.write("</a>\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("\n");
      out.write("<tr style=\"height: 35px;\">\n");
      out.write("<td>\n");
      out.write("&nbsp;&nbsp;&nbsp;&nbsp;&#8226;&nbsp;\n");
      out.write("<a href=\"loginpath?id=logout_link\" style=\"color: darkblue;\">\n");
      out.write("Log Out\n");
      out.write("</a>\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("\n");
      out.write("<!-- more links here? -->\n");
      out.write("\n");
      out.write("<tr style=\"height: 10px;\">\n");
      out.write("<td>\n");
      out.write("&nbsp;\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("<tr>\n");
      out.write("<td>\n");
      out.write("&nbsp;\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("\n");
      out.write("<tr style=\"height: 35px;\">\n");
      out.write("<td>\n");
      out.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n");
      out.write("<a href=\"\" style=\"color: darkblue;\">\n");
      out.write("Help\n");
      out.write("</a>\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("\n");
      out.write("</table>\n");
      out.write("\n");
      out.write("\n");
      out.write("</body>\n");
      out.write("</html>");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("</td>\n");
      out.write("<td style=\"width: 3px; background-color: black;\">&nbsp;</td>\n");
      out.write(
          "<td valign=\"top\" class=\"lightbackgroundwithnormalfont\" style=\"width: 686px;\">\n");
      out.write(
          "<CENTER><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" class=\"smallfont\" style=\"color: black;\">\n");
      out.write("<tr class=\"darkbackgroundwithhugefont\" style=\"height: 35px\">\n");
      out.write("<td colspan=\"3\" valign=\"middle\" align=\"center\">\n");
      out.write("<b>\n");
      out.write("Database Project\n");
      out.write("</b>\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("<tr style=\"height: 5px\">\n");
      out.write("<td colspan=\"3\">\n");
      out.write("&nbsp;\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("</table></CENTER>\n");
      out.write("<hr/>\n");
      out.write("\n");
      out.write("\n");
      out.write("<!-- jsp here to get section name -->\n");
      String section = (String) request.getAttribute("section");
      String crn = (String) request.getAttribute("CRN");
      out.write("\n");
      out.write("\n");
      out.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n");
      out.write("<b class=\"headerfont\">");
      out.println(section);
      out.write(": New Assignment</b><br/><br/>\n");
      out.write("\n");
      out.write("<form method=\"post\" action=\"make_assignment_servlet?id=");
      out.println(crn);
      out.write("\">\n");
      out.write("Enter a name for the assignment:<input type=\"text\" name=\"name\"><br/>\n");
      out.write("Enter Deadline (MM/DD/YYYY):<input type=\"text\" name=\"deadline\"><br/>\n");
      out.write("Enter a description of the assignment:<br/>\n");
      out.write("<textarea name=\"description\"></textarea><br/>\n");
      out.write(
          "Number of questions:<input type=\"text\" size=\"3\" name=\"numQuestions\"><br/>\n");
      out.write("\n");
      out.write("<input type=\"Submit\" name=\"id\" value=\"Save Assignment\">\n");
      out.write("\n");
      out.write("</form>\n");
      out.write("\n");
      out.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\">\n");
      out.write("<tr style=\"height: 5px\">\n");
      out.write("<td colspan=\"3\">\n");
      out.write("&nbsp;\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("</table>\n");
      out.write("</td>\n");
      out.write("<td style=\"width: 3px; background-color: black;\">&nbsp;</td>\n");
      out.write("<td style=\"width: 190px\" class=\"marginbackground\">\n");
      out.write("&nbsp;\n");
      out.write("</td>\n");
      out.write("</tr>\n");
      out.write("</table>\n");
      out.write("</body>\n");
      out.write("</html>");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
Пример #19
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    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 {
      response.setContentType("text/html; charset=ISO-8859-1");
      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;
      _jspx_resourceInjector =
          (org.glassfish.jsp.api.ResourceInjector)
              application.getAttribute("com.sun.appserv.jsp.resource.injector");

      out.write("\n");
      out.write("    \n");
      out.write("    \n");
      out.write("    \n");
      Class.forName("com.mysql.jdbc.Driver");
      out.write("\n");
      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(" <link href=\"css/bootstrap.min.css\" rel=\"stylesheet\">\n");
      out.write("        <!-- Bootstrap css online -->\n");
      out.write(
          "        <link rel=\"stylesheet\" href=\"http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css\">\n");
      out.write("        <link  href=\"css/customcss.css\" rel=\"stylesheet\">\n");
      out.write(
          "        <script type=\"text/javascript\" src=\"js/jquery-1.10.2.min.js\"></script>\n");
      out.write("        <script src=\"js/bootstrap.min.js\"></script>\n");
      out.write("\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n");
      out.write("<title>Analysis of Algorithms : D.B.Phatak</title>\n");
      out.write("</head>\n");
      out.write("<body>\n");
      out.write("\n");
      out.write("<!--Header-->\n");
      out.write("\n");
      out.write("  ");

      String name = (String) session.getAttribute("pass");

      out.write("\n");
      out.write("    <div class=\"container\">\n");
      out.write("             <br>\n");
      out.write("            <!--HEADER -->\n");
      out.write("            <div class=\"header\">\n");
      out.write(
          "                <a href=\"index.jsp\" style=\"color: #000;\"> <ul class=\"nav nav-pills pull-left\" >\n");
      out.write(
          "                    <li id=\"brand_icon\">       <img src=\"Images/mic_logo.png\" alt=\"\" width=\"80px\" height=\"80px\"/></li>\n");
      out.write(
          "                    <li id=\"brand_name\"> <p class=\"title\"><span style=\"font-size: 70px;\">|</span> iClass <strong>Forum</strong></p></li>\n");
      out.write("\n");
      out.write("                </ul></a>\n");
      out.write(
          "                <!--   <p class=\"title1\">iClass</p>&nbsp;&nbsp;<p class=\"title2\">Forum</p> \n");
      out.write("                -->\n");
      out.write("                <form action=\"Login\" method=\"post\">\n");
      out.write("\n");
      out.write(
          "                    <ul class=\"nav nav-pills pull-right\" style=\"margin-top: 35px\">\n");
      out.write("                        <li><a href=\"index.jsp\">Home</a></li>\n");
      out.write("                        <li><a href=\"contactus.jsp\">Contact Us</a></li>\n");
      out.write("\n");
      out.write("                        ");
      if (name != null) {
        try {
          out.write("\n");
          out.write("\n");
          out.write("                        <li><a href=\"logout.jsp\">Logout</a></li>\n");
          out.write("                        <li style=\"margin-top: 10px\">Welcome ");
          out.print(name);
          out.write("</li>\n");
          out.write("\n");
          out.write("                        ");
        } catch (Exception e) {

          System.out.println("Problem :" + e);
        }

      } else {

        out.write("\n");
        out.write("\n");
        out.write("                        <li><a href=\"signup.jsp\">Login</a></li>\n");
        out.write("\n");
        out.write("                        ");
      }
      out.write("\n");
      out.write("\n");
      out.write("                    </ul>\n");
      out.write("                </form>\n");
      out.write("\n");
      out.write("\n");
      out.write("            </div>\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("            <br>\n");
      out.write("         \n");
      out.write("      \n");
      out.write("\n");
      out.write("        <!-- MODAL -->\n");
      out.write("        <form action=\"\" name=\"batti\" method=\"post\">\n");
      out.write("\n");
      out.write(
          "        <div class=\"modal fade\" id=\"myModal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">\n");
      out.write("          <div class=\"modal-dialog\">\n");
      out.write("            <div class=\"modal-content\">\n");
      out.write("              <div class=\"modal-header\">\n");
      out.write(
          "                <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">&times;</button>\n");
      out.write("                <h4 class=\"modal-title\" id=\"myModalLabel\">Answer here</h4>\n");
      out.write("              </div>\n");
      out.write("              <div class=\"modal-body\">\n");
      out.write("                                <div class=\"input-group input-group-lg\">\n");
      out.write("                                <span class=\"input-group-addon\">\n");
      out.write(
          "                                <span class=\"glyphicon glyphicon-pencil\"></span>\n");
      out.write("                                </span>\n");
      out.write(
          "                                <textarea class=\"form-control\" id=\"currentans\" name=\"mainanswer\" rows=\"10\" style=\"resize: vertical;\">\n");
      out.write("                                </textarea>\n");
      out.write("                                </div>\n");
      out.write("              </div>\n");
      out.write("              <div class=\"modal-footer\">\n");
      out.write(
          "              <input type=\"text\" id=\"hidden\" name=\"maindata\" value=\"JAI HO\"/>\n");
      out.write(
          "                <button type=\"button\" class=\"btn btn-primary\" onClick=\"saveAns()\">Save Answer</button>\n");
      out.write("              </div>\n");
      out.write("            </div>\n");
      out.write("          </div>\n");
      out.write("        </div>\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("    </form>\n");
      out.write("    <!-- MODAL ENDS HERE -->\n");
      out.write("\n");
      out.write("<div class=\"page1\" >          \n");
      out.write("                <center>\n");
      out.write("\n");
      out.write(
          "                    <font face=\"myFontThin\" size=\"6\" class=\"title\">Department of  </font><font face=\"myFontThick\" size=\"8\"><b>Computer Science</b></font>\n");
      out.write("                <br>\n");
      out.write("                   <font face=\"myFontThick\" size=\"5\">Prof. sunil</font>\n");
      out.write("                \n");
      out.write("                </center>\n");
      out.write(
          "                <br> <br>  <font face=\"myFontThick\" size=\"6\"><b> bbbbbb </b></font>\n");
      out.write("<br><br><br>\n");
      out.write("                        \n");
      out.write("\n");
      out.write("\n");
      out.write("            ");

      Connection connection =
          DriverManager.getConnection("jdbc:mysql://localhost/aakash", "root", "lavikothari");
      Statement statement = connection.createStatement();
      ResultSet resultset = statement.executeQuery("select * from qa27;");

      int i = 0, no, ct = 0;
      String qid, bid, ansdivid, buttonid, delbuttonid, userid, answerid;

      while (resultset.next()) {
        ct++;
        no = resultset.getInt(1);
        if (i < no) {
          i = no;
        }
        qid = "q" + no;
        ansdivid = "ans" + no;
        bid = "b" + no;
        buttonid = "button" + no;
        delbuttonid = "delbutton" + no;
        userid = "user" + no;
        answerid = "answer" + no;

        out.write("\n");
        out.write("        <!--  <form action=\"\" method=\"get\" name=\"batti\" > -->\n");
        out.write("\t    \n");
        out.write("\t<div class=\"panel panel-default\">\n");
        out.write("            <div class=\"panel-heading\">\n");
        out.write("                <h3 class=\"panel-title\">\n");
        out.write("                <div id=");
        out.print(userid);
        out.write(
            " style=\"font-style:bold ;font-size:15px; padding-left:0.5px ;text-shadow: 2px 2px 8px #6E6E6E\">\n");
        out.write("\t    \t");
        out.print(resultset.getString(4));
        out.write("\n");
        out.write("                </div>\n");
        out.write("                </h3>\n");
        out.write("            </div>\n");
        out.write("            <div class=\"panel-body\">\n");
        out.write("                <div id=");
        out.print(qid);
        out.write(" style=\"text-align:left ;font-size:20px;font-style:italic\">\n");
        out.write("\t\t\t");
        out.print(resultset.getString(2));
        out.write("<br><br>\n");
        out.write("\t\t</div>\n");
        out.write("\t    \t<div class=\"panel panel-default\" id=");
        out.print(ansdivid);
        out.write(" >\n");
        out.write("  \t\t\t\t<div class=\"panel-body\" >\n");
        out.write("   \t\t\t \t\t<p id=");
        out.print(answerid);
        out.write('>');
        out.print(resultset.getString(3));
        out.write("</p>\n");
        out.write(" \t\t \t\t</div>\n");
        out.write("\t\t</div>\n");
        out.write("\t\t<div id=");
        out.print(bid);
        out.write(" >\n");
        out.write("\t\t\t ");
        String condition = (String) session.getAttribute("pass");
        String prof1 = (String) session.getAttribute("Prof");
        String prof2 = (String) session.getAttribute("Prof2");

        // out.println("Lec="+condition);

        // out.println("prof1="+prof1);
        // out.println("prof2="+prof2);
        // System.out.println("Lec="+condition);
        if (condition != null && prof1.equals(prof2)) {

          out.write("       \n");
          out.write("\n");
          out.write(
              "                                <input type=\"button\" class=\"btn btn-primary btn-sm\" style=\"float:right;display:inline\" value=\"Delete\" onClick=\"delQues(this.id)\" id=");
          out.print(delbuttonid);
          out.write(" />\n");
          out.write(
              "                                <input type=\"button\" class=\"btn btn-primary btn-sm\" style=\"float:left;display:inline\" data-toggle=\"modal\" value=\"Answer\" data-target=\"#myModal\" onClick=\"myfunc(this.id)\" id=");
          out.print(buttonid);
          out.write(" />\n");
          out.write("                                ");
        }

        out.write("\n");
        out.write("         \n");
        out.write("\t\t</div>\n");
        out.write("            </div>\n");
        out.write("        </div>\n");
        out.write("\t\n");
        out.write("\t   \n");
        out.write("\t\t\n");
        out.write("        ");
      }
      out.write("\n");
      out.write("\n");
      out.write(
          "               <form action=\"\" name=\"delform\" method=\"post\" style=\"visibility:hidden\">\n");
      out.write("\n");
      out.write(
          "               <input type=\"text\" id= \"delfieldid\" name=\"delfield\" value=\"Namastey\" />\n");
      out.write(
          "               <input type=\"text\" id= \"futureid\" name=\"futurefield\" value=\"London\" />\n");
      out.write("               </form>\n");
      out.write("\n");
      out.write("\n");
      out.write("        <span id =\"debug\" style=\"visibility:hidden\">Hello </span>\n");
      out.write("\n");
      out.write("    </div>\n");
      out.write("</div>    \n");
      out.write("\t    \n");
      out.write(" \n");
      out.write("</div>\n");
      out.write(" \n");
      out.write(" </div>\n");
      out.write("        \n");
      out.write(" \n");
      out.write(" <script type=\"text/javascript\">\n");
      out.write("\t count=");
      out.print(ct);
      out.write(";\n");
      out.write("\t debugging=document.getElementById(\"debug\");\n");
      out.write("\t debugging.innerHTML=\"Count is\"+count;\n");
      out.write("\t hid=document.getElementById(\"hidden\");\n");
      out.write("\t hid.style.display='none';\n");
      out.write("\t \n");
      out.write("\t for (x=1;x<=count;x++)\n");
      out.write("\t {\t\n");
      out.write("\t\t y=document.getElementById(\"answer\"+x);\n");
      out.write("\t\t debug.innerHTML+=y.innerHTML;\n");
      out.write("\t\t z=document.getElementById(\"button\"+x);\n");
      out.write("\t\t if(y!=null && y.innerHTML==\"\")\n");
      out.write("\t\t {\n");
      out.write("\t\t document.getElementById(\"ans\"+x).style.display='none';\n");
      out.write("\t\t }\n");
      out.write("\t\t \n");
      out.write("\t\t else\n");
      out.write("\t\t\t {\n");
      out.write("\t\t\t if(z!=null){\n");
      out.write("\t\t\t z.value=\"Edit Answer\";\n");
      out.write("\t\t\t }\n");
      out.write("\t\t\t }\n");
      out.write("\t }\n");
      out.write("\n");
      out.write("\t function myfunc(clicked_id){\n");
      out.write("\t\t \n");
      out.write("\t\t hid.value=clicked_id;\n");
      out.write("\t\t quesid=clicked_id.replace(\"button\",\"q\");\n");
      out.write("\t\t ansid=clicked_id.replace(\"button\",\"answer\");\n");
      out.write("\t\t \n");
      out.write("\t\t question=document.getElementById(quesid).innerHTML;\n");
      out.write("\t\t answer=document.getElementById(ansid).innerHTML;\n");
      out.write("\t\t \n");
      out.write("\t\t answer.replace(\"  \",\"\");\n");
      out.write("\t\t question.replace(\"  \",\"\");\n");
      out.write("\t\t \n");
      out.write("\t\t document.getElementById(\"myModalLabel\").innerHTML=question;\n");
      out.write("\t\t document.getElementById(\"currentans\").value=answer;\n");
      out.write("\t\t \n");
      out.write("\t }\n");
      out.write("\t \n");
      out.write("\t\n");
      out.write("\t function saveAns()\n");
      out.write("\t {\n");
      out.write("\t\t document.batti.submit();\n");
      out.write("\t\t \n");
      out.write("\t\t ");

      String clid = request.getParameter("maindata");
      if (clid != null) {
        String tobeanswered = clid.replace("button", "");
        System.out.println(tobeanswered);
        String answer = request.getParameter("mainanswer");

        Statement stmt = connection.createStatement();
        String query = "update qa27 set ans ='" + answer + "' where id='" + tobeanswered + "';";

        stmt.executeUpdate(query);

        response.sendRedirect("lec.jsp#user" + tobeanswered);
      }

      out.write("\n");
      out.write("\t }\n");
      out.write("\t \n");
      out.write("\t \n");
      out.write("\n");
      out.write("\t function delQues(clicked_id)\n");
      out.write("\t {\n");
      out.write("\t\t \n");
      out.write("\t\t document.getElementById(\"delfieldid\").value=clicked_id;\n");
      out.write("\t\t \n");
      out.write("\t\t \n");
      out.write("\t\t\t document.getElementById(\"futureid\").value=\"yesssssssss\";\n");
      out.write("\t\t  v=parseInt(clicked_id.replace(\"delbutton\",\"\"))+1;\n");
      out.write("\t\t while(document.getElementById(\"user\"+v)==null && v<count)\n");
      out.write("\t\t\t {\n");
      out.write("\t\t\t v++;\n");
      out.write("\t\t\t document.getElementById(\"futureid\").value=\"user\"+v;\n");
      out.write("\t\t\t }\n");
      out.write("\t\t if(clicked_id==\"delbutton\"+count)\n");
      out.write("\t\t\t {\n");
      out.write("\t\t\t v=parseInt(clicked_id.replace(\"delbutton\",\"\"))-1;\n");
      out.write("\t\t\t }\n");
      out.write("\t\tdocument.getElementById(\"futureid\").value=\"user\"+v;\n");
      out.write("\t\t\t \n");
      out.write("\t\t document.delform.submit();\n");
      out.write("\t\t \n");
      out.write("\t\t ");

      String delid = request.getParameter("delfield");
      if (delid != null) {
        String tobedel = delid.replace("delbutton", "");
        System.out.println("Deleting " + tobedel);

        Statement stmt1 = connection.createStatement();
        String query1 = "delete from qa27 where id='" + tobedel + "';";

        stmt1.executeUpdate(query1);
        String futid = request.getParameter("futurefield");
        response.sendRedirect("lec.jsp#" + futid);
      }

      out.write("\n");
      out.write("\t\t \n");
      out.write("\t }\n");
      out.write("\t \n");
      out.write("\t \n");
      out.write("\t </script>\n");
      out.write("\t\n");
      out.write("\n");
      out.write("</body>\n");
      out.write("</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);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
Пример #20
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=ISO-8859-1");
      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('\r');
      out.write('\n');

      String path = request.getContextPath();
      String basePath =
          request.getScheme()
              + "://"
              + request.getServerName()
              + ":"
              + request.getServerPort()
              + path
              + "/";

      out.write('\r');
      out.write('\n');
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<html>\r\n");
      out.write("\t<head>\r\n");
      out.write("\t\t<base href=\"");
      out.print(basePath);
      out.write("\">\r\n");
      out.write("\r\n");
      out.write("\t\t<title>My JSP 'hello.jsp' starting page</title>\r\n");
      out.write("\r\n");
      out.write("\t\t<meta http-equiv=\"pragma\" content=\"no-cache\">\r\n");
      out.write("\t\t<meta http-equiv=\"cache-control\" content=\"no-cache\">\r\n");
      out.write("\t\t<meta http-equiv=\"expires\" content=\"0\">\r\n");
      out.write("\t\t<meta http-equiv=\"keywords\" content=\"keyword1,keyword2,keyword3\">\r\n");
      out.write("\t\t<meta http-equiv=\"description\" content=\"This is my page\">\r\n");
      out.write("\t\t<!--\r\n");
      out.write("\t<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\">\r\n");
      out.write("\t-->\r\n");
      out.write("\r\n");
      out.write("\t</head>\r\n");
      out.write("\r\n");
      out.write("\t<body>\r\n");
      out.write("\t\t");
      if (_jspx_meth_c_out_0(_jspx_page_context)) return;
      out.write("\r\n");
      out.write("\t</body>\r\n");
      out.write("</html>\r\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);
    }
  }
Пример #21
0
  public synchronized void service(HttpServletRequest request, HttpServletResponse response)
      throws IOException, ServletException {
    HttpSession dbSession = request.getSession();
    JspFactory _jspxFactory = JspFactory.getDefaultFactory();
    PageContext pageContext =
        _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
    ServletContext dbApplication = dbSession.getServletContext();
    PrintWriter out = response.getWriter();
    ServletContext application;
    HttpSession session = request.getSession();
    nseer_db_backup1 finance_db = new nseer_db_backup1(dbApplication);
    ValidataNumber validata = new ValidataNumber();
    try {

      if (finance_db.conn((String) dbSession.getAttribute("unit_db_name"))) {
        String file_id = request.getParameter("file_id");
        String balance_sum = request.getParameter("balance_sum");
        String balance_sum1 = request.getParameter("balance_sum1");
        if (validata.validata(balance_sum) && validata.validata(balance_sum1)) {
          String sql2 = "select id from finance_bill where tag='1' and file_id='" + file_id + "'";
          ResultSet rs2 = finance_db.executeQuery(sql2);
          String sql = "";
          if (rs2.next()) {
            sql =
                "update finance_bill set debit_subtotal='"
                    + balance_sum1
                    + "' where tag='1' and file_id='"
                    + file_id
                    + "'";
          } else {

            sql =
                "insert into finance_bill(debit_subtotal,file_id,tag) values('"
                    + balance_sum1
                    + "','"
                    + file_id
                    + "','1')";
          }
          finance_db.executeUpdate(sql);

          sql2 =
              "select id from finance_voucher where account_period='18' and chain_id='"
                  + file_id
                  + "'";
          rs2 = finance_db.executeQuery(sql2);
          if (rs2.next()) {
            sql =
                "update finance_voucher set debit_subtotal='"
                    + balance_sum
                    + "' where account_period='18' and chain_id='"
                    + file_id
                    + "'";
          } else {

            sql =
                "insert into finance_voucher(debit_subtotal,chain_id,account_period) values('"
                    + balance_sum
                    + "','"
                    + file_id
                    + "','18')";
          }
          finance_db.executeUpdate(sql);

          finance_db.commit();
          finance_db.close();
        } else {
          out.println("1");
        }
      } else {
        response.sendRedirect("error_conn.htm");
      }
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
Пример #22
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    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 {
      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;
      _jspx_resourceInjector =
          (org.apache.jasper.runtime.ResourceInjector)
              application.getAttribute("com.sun.appserv.jsp.resource.injector");

      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n");
      out.write("   \"http://www.w3.org/TR/html4/loose.dtd\">\n");
      out.write("\n");
      out.write("<html>\n");
      out.write("<body>\n");
      out.write('\n');
      out.write('\n');

      PrintWriter write =
          new PrintWriter(
              new BufferedWriter(new FileWriter((getServletContext().getRealPath("/output.csv")))));
      int i;
      String[] NoofBusstop = request.getParameterValues("NoofbusStop");
      String[] routeID = request.getParameterValues("routeID");
      String[] routeInterval = request.getParameterValues("routeInterval");
      String[] busStopID = request.getParameterValues("busStopID");
      String[] busStopName = request.getParameterValues("busStopName");
      String[] busStopDescription = request.getParameterValues("busStopDescription");
      String[] busStopOrder = request.getParameterValues("busStopOrder");
      String[] busStopStatus = request.getParameterValues("busStopStatus");
      String[] busStopPeopleNum = request.getParameterValues("busStopPeopleNum");

      int a = 0;
      int b = 0;
      int count = 0;
      int NoofBusstops = 0;
      out.println(
          "\"routeID\",\"routeInterval \",\"busStopID\",\"busStopName\",\"busStopDescription\",\"busStopOrder\",\"busStopStatus\",\"busStopPeopleNum\"");
      write.println(
          "\"routeID\",\"routeInterval \",\"busStopID\",\"busStopName\",\"busStopDescription\",\"busStopOrder\",\"busStopStatus\",\"busStopPeopleNum\"");

      out.println("<BR>");
      for (i = 0; i < busStopID.length; i++) {

        NoofBusstops = Integer.parseInt(NoofBusstop[b]);
        count++;
        if (count > NoofBusstops) {
          a++;
          b++;
          count = 1;
        }

        out.println(
            routeID[a]
                + ","
                + routeInterval[a]
                + ","
                + busStopID[i]
                + ",\""
                + busStopName[i]
                + "\",\""
                + busStopDescription[i]
                + "\","
                + busStopOrder[i]
                + ","
                + busStopStatus[i]
                + ","
                + busStopPeopleNum[i]
                + "<BR>");

        write.println(
            routeID[a]
                + ","
                + routeInterval[a]
                + ","
                + busStopID[i]
                + ",\""
                + busStopName[i]
                + "\",\""
                + busStopDescription[i]
                + "\","
                + busStopOrder[i]
                + ","
                + busStopStatus[i]
                + ","
                + busStopPeopleNum[i]);
      }

      write.close();

      /*
      out.println(request.getParameter("routeInterval")+"<BR>");
      out.println(request.getParameter("busStopID")+"<BR>");
      out.println(request.getParameter("busStopName")+"<BR>");
      out.println(request.getParameter("busStopDescription")+"<BR>");
      out.println(request.getParameter("busStopOrder")+"<BR>");
      out.println(request.getParameter("busStopStatus")+"<BR>");
      out.println(request.getParameter("busStopPeopleNum")+"<BR>");
      */

      out.write("\n");
      out.write("\n");
      out.write("</body>\n");
      out.write("</html>");
    } 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 {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
  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");
      pageContext =
          _jspxFactory.getPageContext(this, request, response, "error.jsp", true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n\r\n\r\n\r\n\r\n");

      PresencePlugin plugin =
          (PresencePlugin) XMPPServer.getInstance().getPluginManager().getPlugin("presence");

      // Get parameters
      boolean save = request.getParameter("save") != null;
      boolean success = request.getParameter("success") != null;
      boolean presencePublic = ParamUtils.getBooleanParameter(request, "presencePublic");
      String unavailableStatus =
          ParamUtils.getParameter(request, "presenceUnavailableStatus", false);
      if (unavailableStatus == null) {
        unavailableStatus = plugin.getUnavailableStatus();
      }

      // Handle a save
      if (save) {
        plugin.setPresencePublic(presencePublic);
        plugin.setUnavailableStatus(unavailableStatus);
        response.sendRedirect("presence-service.jsp?success=true");
        return;
      }

      presencePublic = plugin.isPresencePublic();

      out.write(
          "\r\n\r\n<html>\r\n    <head>\r\n        <title>Presence Service</title>\r\n        <meta name=\"pageID\" content=\"presence-service\"/>\r\n    </head>\r\n    <body>\r\n\r\n<div class=\"information\">\r\n    ");

      String serverName = XMPPServer.getInstance().getServerInfo().getXMPPDomain();
      int port = JiveGlobals.getXMLProperty("adminConsole.port", -1);
      int securePort = JiveGlobals.getXMLProperty("adminConsole.securePort", -1);
      boolean secureOnly = (port == -1);

      out.write("\r\n\r\n    Presence Service URL:<br>\r\n    <tt>");
      out.print(secureOnly ? "https" : "http");
      out.write(':');
      out.write('/');
      out.write('/');
      out.print(serverName);
      out.write(':');
      out.print(secureOnly ? securePort : port);
      out.write("/plugins/presence/status</tt>\r\n    <br><br>\r\n    Example:<br>\r\n    <tt>");
      out.print(secureOnly ? "https" : "http");
      out.write(':');
      out.write('/');
      out.write('/');
      out.print(serverName);
      out.write(':');
      out.print(secureOnly ? securePort : port);
      out.write("/plugins/presence/status?jid=admin@");
      out.print(serverName);
      out.write(
          "</tt>  \r\n\r\n\r\n</div>\r\n\r\n<p>\r\nUse the form below to configure user presence visibility. By default, user\r\npresence should only be visible to those users that are authorized.<br>\r\n</p>\r\n\r\n");
      if (success) {
        out.write(
            "\r\n\r\n    <div class=\"jive-success\">\r\n    <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n    <tbody>\r\n        <tr><td class=\"jive-icon\"><img src=\"images/success-16x16.gif\" width=\"16\" height=\"16\" border=\"0\"></td>\r\n        <td class=\"jive-icon-label\">\r\n            Presence service properties edited successfully.\r\n        </td></tr>\r\n    </tbody>\r\n    </table>\r\n    </div><br>\r\n");
      }
      out.write(
          "\r\n\r\n<form action=\"presence-service.jsp?save\" method=\"post\">\r\n\r\n<fieldset>\r\n    <legend>Presence visibility</legend>\r\n    <div>\r\n    <p>\r\n    For security reasons, users control which users are authorized to see their presence. However,\r\n    it is posible to configure the service so that anyone has access to all presence information.\r\n    Use this option with caution.\r\n    </p>\r\n    <table cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"100%\">\r\n    <tbody>\r\n        <tr>\r\n            <td width=\"1%\">\r\n            <input type=\"radio\" name=\"presencePublic\" value=\"true\" id=\"rb01\"\r\n             ");
      out.print(((presencePublic) ? "checked" : ""));
      out.write(
          ">\r\n            </td>\r\n            <td width=\"99%\">\r\n                <label for=\"rb01\"><b>Anyone</b> - Anyone may get presence information.</label>\r\n            </td>\r\n        </tr>\r\n        <tr>\r\n            <td width=\"1%\">\r\n            <input type=\"radio\" name=\"presencePublic\" value=\"false\" id=\"rb02\"\r\n             ");
      out.print(((!presencePublic) ? "checked" : ""));
      out.write(
          ">\r\n            </td>\r\n            <td width=\"99%\">\r\n                <label for=\"rb02\"><b>Subscribed</b> - Presence information is only visibile to authorized users.</label>\r\n            </td>\r\n        </tr>\r\n    </tbody>\r\n    </table>\r\n    </div>\r\n</fieldset>\r\n\r\n<br>\r\n    \r\n<fieldset>\r\n    <legend>Plain Text 'Unavailable' Status Message</legend>\r\n    <div>\r\n    <p>\r\n    In &quot;text&quot; mode the status message for unavailable users is &quot;Unavailable&quot;\r\n    by default. It is possible to change the unavailable status message by setting this property.\r\n    </p>\r\n    <p>\r\n        <input type=\"text\" name=\"presenceUnavailableStatus\" value=\"");
      out.print(unavailableStatus);
      out.write(
          "\">\r\n    </p>\r\n    </div>\r\n</fieldset>\r\n\r\n<br><br>\r\n\r\n<input type=\"submit\" value=\"Save Properties\">\r\n</form>\r\n\r\n</body>\r\n</html>");
    } 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(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    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 {
      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('\r');
      out.write('\n');
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");

      String path = request.getContextPath();
      String basePath =
          request.getScheme()
              + "://"
              + request.getServerName()
              + ":"
              + request.getServerPort()
              + path;

      out.write('\r');
      out.write('\n');
      //  c:set
      org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_005fset_005f0 =
          (org.apache.taglibs.standard.tag.rt.core.SetTag)
              _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.get(
                  org.apache.taglibs.standard.tag.rt.core.SetTag.class);
      _jspx_th_c_005fset_005f0.setPageContext(_jspx_page_context);
      _jspx_th_c_005fset_005f0.setParent(null);
      // /context/mytags.jsp(9,0) name = var type = java.lang.String reqTime = false required =
      // false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false
      // methodSignature = null
      _jspx_th_c_005fset_005f0.setVar("webRoot");
      // /context/mytags.jsp(9,0) name = value type = javax.el.ValueExpression reqTime = true
      // required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object
      // deferredMethod = false methodSignature = null
      _jspx_th_c_005fset_005f0.setValue(basePath);
      int _jspx_eval_c_005fset_005f0 = _jspx_th_c_005fset_005f0.doStartTag();
      if (_jspx_th_c_005fset_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
        _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(
            _jspx_th_c_005fset_005f0);
        return;
      }
      _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(
          _jspx_th_c_005fset_005f0);
      out.write("\r\n");
      out.write("<div class=\"easyui-layout\" fit=\"true\">\r\n");
      out.write("<div region=\"center\" style=\"padding: 1px;\">");
      if (_jspx_meth_t_005fdatagrid_005f0(_jspx_page_context)) return;
      out.write("</div>\r\n");
      out.write("</div>\r\n");
      out.write("<script type=\"text/javascript\">\r\n");
      out.write("function editOfficeDocument(docid) {\r\n");
      out.write("\tcreatewindow(\"文档编辑\",'webOfficeController.do?newDocument&id='+docid);\r\n");
      out.write("}\r\n");
      out.write("</script>");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else log(t.getMessage(), t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
Пример #25
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    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 {
      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("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write(
          "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<link type=\"text/css\" rel=\"stylesheet\"\r\n");
      out.write("\thref=\"");
      out.print(request.getContextPath());
      out.write("/css/dep/deplist.css\">\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
      out.write("<title>");
      if (_jspx_meth_decorator_005ftitle_005f0(_jspx_page_context)) return;
      out.write("</title>\r\n");
      if (_jspx_meth_decorator_005fhead_005f0(_jspx_page_context)) return;
      out.write("\r\n");
      out.write("</head>\r\n");
      out.write("<body>\r\n");
      out.write("\r\n");
      out.write("<!-- 用户登陆的情况下 -->\r\n");
      //  s:if
      org.apache.struts2.views.jsp.IfTag _jspx_th_s_005fif_005f0 =
          (org.apache.struts2.views.jsp.IfTag)
              _005fjspx_005ftagPool_005fs_005fif_0026_005ftest.get(
                  org.apache.struts2.views.jsp.IfTag.class);
      _jspx_th_s_005fif_005f0.setPageContext(_jspx_page_context);
      _jspx_th_s_005fif_005f0.setParent(null);
      // /WEB-INF/decorator/basic.jsp(17,0) name = test type = java.lang.String reqTime = false
      // required = true fragment = false deferredValue = false expectedTypeName = null
      // deferredMethod = false methodSignature = null
      _jspx_th_s_005fif_005f0.setTest("#session.loginUser != null");
      int _jspx_eval_s_005fif_005f0 = _jspx_th_s_005fif_005f0.doStartTag();
      if (_jspx_eval_s_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
        if (_jspx_eval_s_005fif_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
          out = _jspx_page_context.pushBody();
          _jspx_th_s_005fif_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
          _jspx_th_s_005fif_005f0.doInitBody();
        }
        do {
          out.write("\r\n");
          out.write("\t欢迎[");
          out.write(
              (java.lang.String)
                  org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(
                      "${session.loginUser.nickname}",
                      java.lang.String.class,
                      (PageContext) _jspx_page_context,
                      null,
                      false));
          out.write("]登录系统,你可以:\r\n");
          out.write("\t<a href=\"");
          out.print(request.getContextPath());
          out.write("/dep/dep_addInput\">添加部门</a>\r\n");
          out.write("\t<a href=\"");
          out.print(request.getContextPath());
          out.write("/user/user_addInput\">添加用户</a>\r\n");
          out.write("\t<a href=\"");
          out.print(request.getContextPath());
          out.write("/user/user_updateInput?user.id=");
          out.write(
              (java.lang.String)
                  org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(
                      "${session.loginUser.id}",
                      java.lang.String.class,
                      (PageContext) _jspx_page_context,
                      null,
                      false));
          out.write("\">修改个人信息</a>\r\n");
          out.write("\t<a href=\"");
          out.print(request.getContextPath());
          out.write("/msg/msg_addInput\">新建私信</a>\r\n");
          out.write("\t<a href=\"");
          out.print(request.getContextPath());
          out.write("/msg/msg_listRevMsg\">查看收件箱</a>\r\n");
          out.write("\t<a href=\"");
          out.print(request.getContextPath());
          out.write("/msg/msg_listSendedMsg\">查看发件箱</a>\r\n");
          out.write("\t<a href=\"");
          out.print(request.getContextPath());
          out.write("/doc/doc_addInput\">新建公文</a>\r\n");
          out.write("\t<a href=\"");
          out.print(request.getContextPath());
          out.write("/doc/doc_listRevDoc\">查看收到公文</a>\r\n");
          out.write("\t<a href=\"");
          out.print(request.getContextPath());
          out.write("/doc/doc_listSendedDoc\">查看已发公文</a>\r\n");
          out.write("\t<a href=\"");
          out.print(request.getContextPath());
          out.write("/logout\">退出登录</a>\r\n");
          int evalDoAfterBody = _jspx_th_s_005fif_005f0.doAfterBody();
          if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break;
        } while (true);
        if (_jspx_eval_s_005fif_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
          out = _jspx_page_context.popBody();
        }
      }
      if (_jspx_th_s_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
        _005fjspx_005ftagPool_005fs_005fif_0026_005ftest.reuse(_jspx_th_s_005fif_005f0);
        return;
      }
      _005fjspx_005ftagPool_005fs_005fif_0026_005ftest.reuse(_jspx_th_s_005fif_005f0);
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<hr>\r\n");
      out.write("<h1 align=\"center\">");
      if (_jspx_meth_decorator_005ftitle_005f1(_jspx_page_context)) return;
      out.write("</h1>\r\n");
      if (_jspx_meth_decorator_005fbody_005f0(_jspx_page_context)) return;
      out.write("\r\n");
      out.write("<hr>\r\n");
      out.write("</body>\r\n");
      out.write("</html>");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    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 {
      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;
      _jspx_resourceInjector =
          (org.glassfish.jsp.api.ResourceInjector)
              application.getAttribute("com.sun.appserv.jsp.resource.injector");

      out.write('\n');
      out.write('\n');
      out.write('\n');

      request.setCharacterEncoding("UTF-8");
      boolean isRTL = UrlUtil.isRTL(request, response);
      String direction = isRTL ? "rtl" : "ltr";
      if (new RequestData(application, request, response).isMozilla()) {

        out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n");

      } else {

        out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
      }

      out.write(
          "<!------------------------------------------------------------------------------\n");
      out.write(" ! Copyright (c) 2000, 2007 IBM Corporation and others.\n");
      out.write(" ! All rights reserved. This program and the accompanying materials \n");
      out.write(" ! are made available under the terms of the Eclipse Public License v1.0\n");
      out.write(" ! which accompanies this distribution, and is available at\n");
      out.write(" ! http://www.eclipse.org/legal/epl-v10.html\n");
      out.write(" ! \n");
      out.write(" ! Contributors:\n");
      out.write(" !     IBM Corporation - initial API and implementation\n");
      out.write(
          " ------------------------------------------------------------------------------->");
      out.write('\n');
      out.write('\n');

      SearchData data = new SearchData(application, request, response);
      WebappPreferences prefs = data.getPrefs();

      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("<html lang=\"");
      out.print(ServletResources.getString("locale", request));
      out.write("\">\n");
      out.write("<head>\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
      out.write("\n");
      out.write("<title>");
      out.print(ServletResources.getString("SearchLabel", request));
      out.write("</title>\n");
      out.write("     \n");
      out.write("<style type=\"text/css\">\n");
      out.write("/* need this one for Mozilla */\n");
      out.write("HTML { \n");
      out.write("\twidth:100%;\n");
      out.write("\theight:100%;\n");
      out.write("\tmargin:0px;\n");
      out.write("\tpadding:0px;\n");
      out.write("\tborder:0px;\n");
      out.write(" }\n");
      out.write("\n");
      out.write("BODY {\n");
      out.write("\tbackground:");
      out.print(prefs.getToolbarBackground());
      out.write(";\n");
      out.write("\tborder:0px;\n");
      out.write("\theight:100%;\n");
      out.write("}\n");
      out.write("\n");
      out.write("TABLE {\n");
      out.write("\tfont: ");
      out.print(prefs.getToolbarFont());
      out.write(";\n");
      out.write("\tbackground:");
      out.print(prefs.getToolbarBackground());
      out.write(";\n");
      out.write("\tmargin: 0px;\n");
      out.write("\tpadding: 0px;\n");
      out.write("\theight:100%;\n");
      out.write("}\n");
      out.write("\n");
      out.write("FORM {\n");
      out.write("\tbackground:");
      out.print(prefs.getToolbarBackground());
      out.write(";\n");
      out.write("\theight:100%;\n");
      out.write("\tmargin:0px;\n");
      out.write("}\n");
      out.write("\n");
      out.write("INPUT {\n");
      out.write("\tfont: ");
      out.print(prefs.getToolbarFont());
      out.write(";\n");
      out.write("\tmargin:0px;\n");
      out.write("\tpadding:0px;\n");
      out.write("}\n");
      out.write("\n");
      out.write("INPUT {\n");
      out.write("    font-size: 1.0em;\n");
      out.write("}\n");
      out.write("\n");
      out.write("A {\n");
      out.write("\tcolor:WindowText;\n");
      out.write("\ttext-decoration:none;\n");
      out.write("}\n");
      out.write("\n");
      out.write("#searchTD {\n");
      out.write("\tpadding-");
      out.print(isRTL ? "right" : "left");
      out.write(":7px;\n");
      out.write("\tpadding-");
      out.print(isRTL ? "left" : "right");
      out.write(":4px;\n");
      out.write("}\n");
      out.write("\n");
      out.write("#searchWord {\n");
      out.write("\tmargin-left:5px;\n");
      out.write("\tmargin-right:5px;\n");
      out.write("\tborder:1px solid ThreeDShadow;\n");
      out.write("}\n");
      out.write("\n");
      out.write("#searchLabel {\n");
      out.write("\tcolor:WindowText;\n");
      out.write("}\n");
      out.write("\n");
      out.write("#go {\n");

      if (data.isMacMozilla()) {

        out.write("\n");
        out.write("    background:GrayText;\n");

      } else {

        out.write("\n");
        out.write("    background:ThreeDShadow;\n");
      }

      out.write("\n");
      out.write("\tcolor:Window;\n");
      out.write("\tfont-weight:bold;\n");
      out.write("\tborder:1px solid ThreeDShadow;\n");
      out.write("\tmargin-left:1px;\n");
      out.write("\tfont-size: 1.0em;\n");
      out.write("}\n");
      out.write("\n");
      out.write("#scopeLabel {\n");
      out.write("\ttext-decoration:underline; \n");
      out.write("\tcolor:#0066FF; \n");
      out.write("\tcursor:pointer;\n");
      out.write("\tpadding-left:15px;   /* This should be the same for both RTL and LTR. */\n");
      out.write("}\n");
      out.write("\n");
      out.write("#scope { \n");
      out.write("\ttext-align:");
      out.print(isRTL ? "left" : "right");
      out.write(";\n");
      out.write("\tmargin-");
      out.print(isRTL ? "right" : "left");
      out.write(":5px;\n");
      out.write("\tborder:0px;\n");
      out.write("\tcolor:WindowText;\n");
      out.write("\ttext-decoration:none;\n");
      out.write("}\n");
      out.write("\n");

      if (data.isIE()) {

        out.write("\n");
        out.write("#go {\n");
        out.write("\tpadding-");
        out.print(isRTL ? "right" : "left");
        out.write(":1px;\n");
        out.write("}\n");
      }

      out.write("\n");
      out.write("</style>\n");
      out.write("\n");
      out.write("<script language=\"JavaScript\">\n");
      out.write("var isIE = navigator.userAgent.indexOf('MSIE') != -1;\n");
      out.write(
          "var isMozilla = navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && parseInt(navigator.appVersion.substring(0,1)) >= 5;\n");
      out.write("\n");
      out.write("var advancedDialog;\n");
      out.write("\n");
      out.write("function openAdvanced() \n");
      out.write("{ \n");
      out.write("    var scope = document.getElementById(\"scope\").firstChild;\n");
      out.write("    var workingSet = \"\"; \n");
      out.write("    if (scope != null) \n");
      out.write(
          "              workingSet = document.getElementById(\"scope\").firstChild.nodeValue;                \n");
      out.write("    var minSize = 300; \n");
      out.write("    var maxHeight= 500;  \n");
      out.write("    var maxWidth = 600;       \n");
      out.write("    var w = minSize; \n");
      out.write("    var h = minSize; \n");
      out.write("      \n");
      out.write(
          "    // If we have large fonts make the dialog larger, up to 500 pixels high, 600 wide\n");
      out.write("    try {         \n");
      out.write(
          "        var letterHeight = document.getElementById(\"searchWord\").offsetHeight; \n");
      out.write("        var requiredSize = 16 * letterHeight; \n");
      out.write("        if (requiredSize > minSize) { \n");
      out.write("            if (requiredSize < maxWidth) { \n");
      out.write("                w = requiredSize; \n");
      out.write("            } else { \n");
      out.write("                w =  maxWidth; \n");
      out.write("            }\n");
      out.write("            if (requiredSize < maxHeight) { \n");
      out.write("                h = requiredSize; \n");
      out.write("            } else {               \n");
      out.write("                h = maxHeight;\n");
      out.write("            }\n");
      out.write("        } \n");
      out.write("             \n");
      out.write("    } catch (e) {} \n");
      out.write("    \n");

      if (data.isIE()) {

        out.write("\n");
        out.write("\tvar l = parent.screenLeft + (parent.document.body.clientWidth - w) / 2;\n");
        out.write("\tvar t = parent.screenTop + (parent.document.body.clientHeight - h) / 2;\n");

      } else {

        out.write("\n");
        out.write("\tvar l = parent.screenX + (parent.innerWidth - w) / 2;\n");
        out.write("\tvar t = parent.screenY + (parent.innerHeight - h) / 2;\n");
      }

      out.write("\n");
      out.write("\t// move the dialog just a bit higher than the middle\n");
      out.write("\tif (t-50 > 0) t = t-50;\n");
      out.write("\t\n");
      out.write("\twindow.location=\"javascript://needModal\";\n");
      out.write(
          "\tadvancedDialog = window.open(\"workingSetManager.jsp?workingSet=\"+encodeURIComponent(workingSet), \"advancedDialog\", \"resizable=yes,height=\"+h+\",width=\"+w+\",left=\"+l+\",top=\"+t );\n");
      out.write("\tadvancedDialog.focus(); \n");
      out.write("}\n");
      out.write("\n");
      out.write("function closeAdvanced()\n");
      out.write("{\n");
      out.write("\ttry {\n");
      out.write("\t\tif (advancedDialog)\n");
      out.write("\t\t\tadvancedDialog.close();\n");
      out.write("\t}\n");
      out.write("\tcatch(e) {}\n");
      out.write("}\n");
      out.write("\n");
      out.write("/**\n");
      out.write(" * This function can be called from this page or from\n");
      out.write(" * the advanced search page. When called from the advanced\n");
      out.write(" * search page, a query is passed.\n");
      out.write(" * noRefocus is a boolean which if true suppresses\n");
      out.write(" * switch of focus to the search view\n");
      out.write(" */\n");
      out.write("function doSearch(query, noRefocus)\n");
      out.write("{\n");
      out.write("\tvar workingSet = document.getElementById(\"scope\").firstChild.nodeValue;\n");
      out.write("\n");
      out.write("\tvar form = document.forms[\"searchForm\"];\n");
      out.write("\tvar searchWord = form.searchWord.value;\n");
      out.write("\tvar maxHits = form.maxHits.value;\n");
      out.write("\tif (!searchWord || searchWord == \"\")\n");
      out.write("\t\treturn;\n");
      out.write("\tquery =\"searchWord=\"+encodeURIComponent(searchWord)+\"&maxHits=\"+maxHits;\n");
      out.write("\tif (workingSet != '");
      out.print(UrlUtil.JavaScriptEncode(ServletResources.getString("All", request)));
      out.write("')\n");
      out.write("\t\tquery = query +\"&scope=\"+encodeURIComponent(workingSet);\n");
      out.write("\t\t\n");
      out.write("\t/******** HARD CODED VIEW NAME *********/\n");
      out.write("\t// do some tests to ensure the results are available\n");
      out.write("\tif (parent.parent.HelpFrame && \n");
      out.write("\t\tparent.parent.HelpFrame.NavFrame && \n");
      out.write("\t\tparent.parent.HelpFrame.NavFrame.showView &&\n");
      out.write("\t\tparent.parent.HelpFrame.NavFrame.ViewsFrame && \n");
      out.write("\t\tparent.parent.HelpFrame.NavFrame.ViewsFrame.search && \n");
      out.write("\t\tparent.parent.HelpFrame.NavFrame.ViewsFrame.search.searchViewFrame) \n");
      out.write("\t{\n");
      out.write("\t    if (!noRefocus) {\n");
      out.write("\t\t    parent.parent.HelpFrame.NavFrame.showView(\"search\");\n");
      out.write("\t\t}\n");
      out.write(
          "\t\tvar searchView = parent.parent.HelpFrame.NavFrame.ViewsFrame.search.searchViewFrame;\n");
      out.write("\t\tsearchView.location.replace(\"searchView.jsp?\"+query);\n");
      out.write("\t}\n");
      out.write("}\n");
      out.write("\n");
      out.write("function getSearchWord() {\n");
      out.write("    var form = document.forms[\"searchForm\"];\n");
      out.write("    var searchWord = form.searchWord.value;\n");
      out.write("    if (searchWord ) {\n");
      out.write("        return searchWord;\n");
      out.write("    }\n");
      out.write("    return \"\";\n");
      out.write("}\n");
      out.write("\n");
      out.write("function rescope() {\n");
      out.write("    if (parent.parent.HelpFrame && \n");
      out.write("\t\tparent.parent.HelpFrame.NavFrame && \n");
      out.write("\t\tparent.parent.HelpFrame.NavFrame.ViewsFrame) {\n");
      out.write("\t\tvar viewsFrame = parent.parent.HelpFrame.NavFrame.ViewsFrame;\n");
      out.write("\t\tif (viewsFrame.toc && viewsFrame.toc.tocViewFrame) {\n");
      out.write("\t\t    var tocView = viewsFrame.toc.tocViewFrame;\n");
      out.write("\t\t    tocView.repaint();\n");
      out.write("\t\t}\n");
      out.write("\t\tif (viewsFrame.index && viewsFrame.index.indexViewFrame) {\n");
      out.write("\t\t    var indexView = viewsFrame.index.indexViewFrame;\n");
      out.write("\t\t    indexView.repaint();\n");
      out.write("\t\t}\n");
      out.write("\t\tdoSearch(null, true);\n");
      out.write("\t}\n");
      out.write("}\n");
      out.write("\n");
      out.write("function fixHeights()\n");
      out.write("{\n");
      out.write("\tif (!isIE) return;\n");
      out.write("\t\n");
      out.write("\tvar h = document.getElementById(\"searchWord\").offsetHeight;\n");
      out.write("\tdocument.getElementById(\"go\").style.height = h;\n");
      out.write("}\n");
      out.write("\n");
      out.write("function onloadHandler(e)\n");
      out.write("{\n");
      out.write("\tvar form = document.forms[\"searchForm\"];\n");
      out.write("\tform.searchWord.value = '");
      out.print(UrlUtil.JavaScriptEncode(data.getSearchWord()));
      out.write("';\n");
      out.write("\tfixHeights();\n");

      if (data.isScopeRequest() && RequestScope.filterBySearchScope(request)) {

        out.write("\n");
        out.write("    rescope();\n");
      }

      out.write("\n");
      out.write("}\n");
      out.write("\n");
      out.write("</script>\n");
      out.write("\n");
      out.write("</head>\n");
      out.write("\n");
      out.write("<body dir=\"");
      out.print(direction);
      out.write("\" onload=\"onloadHandler()\"  onunload=\"closeAdvanced()\">\n");
      out.write("\n");
      out.write("\t<form  name=\"searchForm\"   onsubmit=\"doSearch()\">\n");
      out.write("\t<div role=\"search\">\n");
      out.write("\t\t<table id=\"searchTable\" align=\"");
      out.print(isRTL ? "right" : "left");
      out.write(
          "\" valign=\"middle\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" role=\"presentation\">\n");
      out.write("\t\t\t<tr nowrap  valign=\"middle\">\n");
      out.write("\t\t\t\t<td ");
      out.print(isRTL ? "nowrap" : "");
      out.write(" id=\"searchTD\">\n");
      out.write("\t\t\t\t\t<label id=\"searchLabel\" for=\"searchWord\" accesskey=\"");
      out.print(ServletResources.getAccessKey("SearchLabel", request));
      out.write("\">\n");
      out.write("\t\t\t\t\t&nbsp;");
      out.print(ServletResources.getLabel("SearchLabel", request));
      out.write("\n");
      out.write("\t\t\t\t\t</label>\n");
      out.write("\t\t\t\t</td>\n");
      out.write("\t\t\t\t<td>\n");
      out.write(
          "\t\t\t\t\t<input type=\"text\" id=\"searchWord\" name=\"searchWord\" value='' size=\"24\" maxlength=\"256\" \n");
      out.write("\t\t\t\t\t       alt=\"");
      out.print(UrlUtil.htmlEncode(ServletResources.getString("expression_label", request)));
      out.write("\" \n");
      out.write("\t\t\t\t\t       title=\"");
      out.print(UrlUtil.htmlEncode(ServletResources.getString("expression_label", request)));
      out.write("\">\n");
      out.write("\t\t\t\t</td>\n");
      out.write("\t\t\t\t<td >\n");
      out.write(
          "\t\t\t\t\t<input type=\"submit\" role=\"button\" onclick=\"this.blur();doSearch()\" value=\"");
      out.print(ServletResources.getString("GO", request));
      out.write("\" id=\"go\" alt=\"");
      out.print(ServletResources.getString("GO", request));
      out.write("\" title=\"");
      out.print(ServletResources.getString("GO", request));
      out.write("\">\n");
      out.write("\t\t\t\t\t<input type=\"hidden\" name=\"maxHits\" value=\"500\" >\n");
      out.write("\t\t\t\t</td>\n");
      out.write("\t\t\t\t<td nowrap>\n");
      out.write("\t\t\t\t\t<a id=\"scopeLabel\" href=\"javascript:openAdvanced();\" title=\"");
      out.print(ServletResources.getString("ScopeTooltip", request));
      out.write("\" alt=\"");
      out.print(ServletResources.getString("ScopeTooltip", request));
      out.write("\" onmouseover=\"window.status='");
      out.print(UrlUtil.JavaScriptEncode(ServletResources.getString("ScopeTooltip", request)));
      out.write("'; return true;\" onmouseout=\"window.status='';\">");
      out.print(ServletResources.getLabel("Scope", request));
      out.write("</a>\n");
      out.write("\t\t\t\t</td>\n");
      out.write("\t\t\t\t<td nowrap>\n");
      out.write("\t\t\t\t\t<input type=\"hidden\" name=\"workingSet\" value='");
      out.print(UrlUtil.htmlEncode(data.getScope()));
      out.write("'>\n");
      out.write("\t\t\t\t\t<div id=\"scope\" >");
      out.print(UrlUtil.htmlEncode(data.getScope()));
      out.write("</div>\n");
      out.write("\t\t\t\t</td>\n");
      out.write("\t\t\t</tr>\n");
      out.write("\n");
      out.write("\t\t</table>\n");
      out.write("\t</div>\n");
      out.write("\t</form>\t\t\n");
      out.write("\n");
      out.write("</body>\n");
      out.write("</html>\n");
      out.write("\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);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
Пример #27
0
  public void generateFileChunks(JspWriter out, HttpServletRequest req) throws IOException {
    long startOffset = 0;

    int chunkSizeToView = 0;

    String referrer = req.getParameter("referrer");
    boolean noLink = false;
    if (referrer == null) {
      noLink = true;
    }

    String filename = req.getParameter("filename");
    if (filename == null) {
      out.print("Invalid input (file name absent)");
      return;
    }

    String namenodeInfoPortStr = req.getParameter("namenodeInfoPort");
    int namenodeInfoPort = -1;
    if (namenodeInfoPortStr != null) namenodeInfoPort = Integer.parseInt(namenodeInfoPortStr);

    String chunkSizeToViewStr = req.getParameter("chunkSizeToView");
    if (chunkSizeToViewStr != null && Integer.parseInt(chunkSizeToViewStr) > 0)
      chunkSizeToView = Integer.parseInt(chunkSizeToViewStr);
    else chunkSizeToView = jspHelper.defaultChunkSizeToView;

    if (!noLink) {
      out.print("<h3>Tail of File: ");
      JspHelper.printPathWithLinks(filename, out, namenodeInfoPort);
      out.print("</h3><hr>");
      out.print("<a href=\"" + referrer + "\">Go Back to File View</a><hr>");
    } else {
      out.print("<h3>" + filename + "</h3>");
    }
    out.print("<b>Chunk size to view (in bytes, up to file's DFS block size): </b>");
    out.print(
        "<input type=\"text\" name=\"chunkSizeToView\" value="
            + chunkSizeToView
            + " size=10 maxlength=10>");
    out.print("&nbsp;&nbsp;<input type=\"submit\" name=\"submit\" value=\"Refresh\"><hr>");
    out.print("<input type=\"hidden\" name=\"filename\" value=\"" + filename + "\">");
    out.print(
        "<input type=\"hidden\" name=\"namenodeInfoPort\" value=\"" + namenodeInfoPort + "\">");
    if (!noLink) out.print("<input type=\"hidden\" name=\"referrer\" value=\"" + referrer + "\">");

    // fetch the block from the datanode that has the last block for this file
    DFSClient dfs = new DFSClient(jspHelper.nameNodeAddr, jspHelper.conf);
    List<LocatedBlock> blocks =
        dfs.namenode.getBlockLocations(filename, 0, Long.MAX_VALUE).getLocatedBlocks();
    if (blocks == null || blocks.size() == 0) {
      out.print("No datanodes contain blocks of file " + filename);
      dfs.close();
      return;
    }
    LocatedBlock lastBlk = blocks.get(blocks.size() - 1);
    long blockSize = lastBlk.getBlock().getNumBytes();
    long blockId = lastBlk.getBlock().getBlockId();
    long genStamp = lastBlk.getBlock().getGenerationStamp();
    DatanodeInfo chosenNode;
    try {
      chosenNode = jspHelper.bestNode(lastBlk);
    } catch (IOException e) {
      out.print(e.toString());
      dfs.close();
      return;
    }
    InetSocketAddress addr = NetUtils.createSocketAddr(chosenNode.getName());
    // view the last chunkSizeToView bytes while Tailing
    if (blockSize >= chunkSizeToView) startOffset = blockSize - chunkSizeToView;
    else startOffset = 0;

    out.print("<textarea cols=\"100\" rows=\"25\" wrap=\"virtual\" style=\"width:100%\" READONLY>");
    jspHelper.streamBlockInAscii(
        addr, blockId, genStamp, blockSize, startOffset, chunkSizeToView, out);
    out.print("</textarea>");
    dfs.close();
  }
Пример #28
0
  public synchronized void doPost(HttpServletRequest request, HttpServletResponse response)
      throws IOException, ServletException {
    HttpSession dbSession = request.getSession();
    JspFactory _jspxFactory = JspFactory.getDefaultFactory();
    PageContext pageContext =
        _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
    ServletContext dbApplication = dbSession.getServletContext();

    try {
      PrintWriter out = response.getWriter();

      nseer_db_backup1 stock_db = new nseer_db_backup1(dbApplication);
      nseer_db_backup1 crm_db = new nseer_db_backup1(dbApplication);
      if (stock_db.conn((String) dbSession.getAttribute("unit_db_name"))
          && crm_db.conn((String) dbSession.getAttribute("unit_db_name"))) {

        FileKind FileKind = new FileKind();
        ValidataNumber validata = new ValidataNumber();
        ValidataRecord vr = new ValidataRecord();

        counter count = new counter(dbApplication);
        ValidataTag vt = new ValidataTag();
        String register_ID = (String) dbSession.getAttribute("human_IDD");
        String config_id = request.getParameter("config_id");
        String pay_ID = request.getParameter("pay_ID");
        String product_amount = request.getParameter("product_amount");
        int num = Integer.parseInt(product_amount);
        String payer_name = request.getParameter("payer_name");
        String payer_ID = request.getParameter("payer_ID");
        String reason = request.getParameter("reason");
        String not_return_tag = request.getParameter("not_return_tag");
        String register = request.getParameter("register");
        String register_time = request.getParameter("register_time");
        String demand_return_time = request.getParameter("demand_return_time");
        String sales_name = request.getParameter("sales_name");
        String sales_ID = request.getParameter("sales_ID");
        String bodyc = new String(request.getParameter("remark").getBytes("UTF-8"), "UTF-8");
        String remark = exchange.toHtml(bodyc);
        String time = "";
        java.util.Date now = new java.util.Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
        time = formatter.format(now);
        String[] product_IDn = request.getParameterValues("product_ID");
        String[] amountn = request.getParameterValues("amount");
        if (num == 0 && product_IDn.length == 1) {
          response.sendRedirect("draft/crm/credit_ok_a.jsp?pay_ID=" + pay_ID);
        } else {
          int p = 0;
          for (int i = 1; i <= num; i++) {
            String tem_amount = "amount" + i;
            String amount = request.getParameter(tem_amount);
            if (amount.equals("")) amount = "0";
            if (!validata.validata(amount)) {
              p++;
            }
          }
          int n = 0;
          String product_ID_group = "";
          for (int j = 1; j < product_IDn.length; j++) {
            product_ID_group += product_IDn[j] + ",";
            if (amountn[j].equals("")) amountn[j] = "0";
            if (!validata.validata(amountn[j])) {
              p++;
            }
          }
          for (int i = 1; i <= num; i++) {
            String tem_product_ID = "product_ID" + i;
            String product_ID = request.getParameter(tem_product_ID);
            if (product_ID_group.indexOf(product_ID) != -1) n++;
          }
          if (vt.validata(
                      (String) dbSession.getAttribute("unit_db_name"),
                      "stock_apply_pay",
                      "pay_ID",
                      pay_ID,
                      "check_tag")
                  .equals("9")
              || vt.validata(
                      (String) dbSession.getAttribute("unit_db_name"),
                      "stock_apply_pay",
                      "pay_ID",
                      pay_ID,
                      "check_tag")
                  .equals("5")) {

            if (p == 0) {
              try {
                if (n == 0) {
                  boolean flag = false;
                  List rsList = GetWorkflow.getList(crm_db, "crm_config_workflow", "05");
                  String[] elem = new String[3];
                  if (rsList.size() == 0) {
                    flag = true;
                  }
                  String sqll = "";
                  String[] aaa1 =
                      FileKind.getKind(
                          (String) dbSession.getAttribute("unit_db_name"),
                          "crm_file",
                          "customer_ID",
                          payer_ID);

                  String stock_pay_ID =
                      NseerId.getId("stock/pay", (String) dbSession.getAttribute("unit_db_name"));
                  double demand_amount = 0.0d;
                  double list_price_sum = 0.0d;
                  double cost_price_sum = 0.0d;

                  for (int i = 1; i <= num; i++) {
                    String tem_product_name = "product_name" + i;
                    String tem_product_ID = "product_ID" + i;
                    String tem_available_amount = "available_amount" + i;
                    String tem_amount = "amount" + i;
                    String tem_list_price = "list_price" + i;
                    String tem_cost_price = "cost_price" + i;
                    String tem_type = "type" + i;
                    String tem_amount_unit = "amount_unit" + i;
                    String product_name = request.getParameter(tem_product_name);
                    String product_ID = request.getParameter(tem_product_ID);
                    String available_amount = request.getParameter(tem_available_amount);
                    String amount = request.getParameter(tem_amount);
                    if (amount.equals("")) amount = "0";
                    String list_price2 = request.getParameter(tem_list_price);
                    String cost_price = request.getParameter(tem_cost_price);
                    String type = request.getParameter(tem_type);
                    StringTokenizer tokenTO3 = new StringTokenizer(list_price2, ",");
                    String list_price = "";
                    while (tokenTO3.hasMoreTokens()) {
                      String list_price1 = tokenTO3.nextToken();
                      list_price += list_price1;
                    }
                    String amount_unit = request.getParameter(tem_amount_unit);
                    double list_price_subtotal =
                        Double.parseDouble(list_price) * Double.parseDouble(amount);
                    list_price_sum += list_price_subtotal;
                    double cost_price_subtotal =
                        Double.parseDouble(cost_price) * Double.parseDouble(amount);
                    cost_price_sum += cost_price_subtotal;
                    demand_amount += Double.parseDouble(amount);
                    String sql1 =
                        "update stock_apply_pay_details set amount='"
                            + amount
                            + "',list_price='"
                            + list_price
                            + "',list_price_subtotal='"
                            + list_price_subtotal
                            + "',cost_price='"
                            + cost_price
                            + "',subtotal='"
                            + cost_price_subtotal
                            + "' where pay_ID='"
                            + pay_ID
                            + "' and details_number='"
                            + i
                            + "'";
                    stock_db.executeUpdate(sql1);
                    if (flag) {
                      if (type.equals("物料") || type.equals("外购商品")) {
                        String sql2 =
                            "insert into stock_pay_details(pay_ID,details_number,product_ID,product_name,type,list_price,list_price_subtotal,cost_price,subtotal,amount,unpay_amount,apply_manufacture_amount,apply_purchase_amount) values('"
                                + stock_pay_ID
                                + "','"
                                + i
                                + "','"
                                + product_ID
                                + "','"
                                + product_name
                                + "','"
                                + type
                                + "','"
                                + list_price
                                + "','"
                                + list_price_subtotal
                                + "','"
                                + cost_price
                                + "','"
                                + cost_price_subtotal
                                + "','"
                                + amount
                                + "','"
                                + amount
                                + "','0','"
                                + amount
                                + "')";
                        stock_db.executeUpdate(sql2);
                      } else if (type.equals("商品") || type.equals("部件") || type.equals("委外部件")) {
                        String sql2 =
                            "insert into stock_pay_details(pay_ID,details_number,product_ID,product_name,type,list_price,list_price_subtotal,cost_price,subtotal,amount,unpay_amount,apply_manufacture_amount,apply_purchase_amount) values('"
                                + stock_pay_ID
                                + "','"
                                + i
                                + "','"
                                + product_ID
                                + "','"
                                + product_name
                                + "','"
                                + type
                                + "','"
                                + list_price
                                + "','"
                                + list_price_subtotal
                                + "','"
                                + cost_price
                                + "','"
                                + cost_price_subtotal
                                + "','"
                                + amount
                                + "','"
                                + amount
                                + "','"
                                + amount
                                + "','0')";
                        stock_db.executeUpdate(sql2);
                      }

                      String sql97 =
                          "select * from crm_salecredit_balance_details where crediter_ID='"
                              + payer_ID
                              + "' and product_ID='"
                              + product_ID
                              + "'";
                      ResultSet rs97 = crm_db.executeQuery(sql97);
                      if (rs97.next()) {
                        double balance_amount =
                            rs97.getDouble("amount") + Double.parseDouble(amount);
                        double balance_cost_price_subtotal =
                            rs97.getDouble("subtotal") + cost_price_subtotal;
                        double balance_list_price_subtotal =
                            rs97.getDouble("list_price_subtotal") + list_price_subtotal;

                        String sql96 =
                            "update crm_salecredit_balance_details set amount='"
                                + balance_amount
                                + "',check_tag='1',subtotal='"
                                + balance_cost_price_subtotal
                                + "',list_price_subtotal='"
                                + balance_list_price_subtotal
                                + "' where crediter_ID='"
                                + payer_ID
                                + "' and product_ID='"
                                + product_ID
                                + "'";
                        crm_db.executeUpdate(sql96);
                      } else {
                        String[] aaa =
                            FileKind.getKind(
                                (String) dbSession.getAttribute("unit_db_name"),
                                "design_file",
                                "product_ID",
                                product_ID);
                        String sql95 =
                            "insert into crm_salecredit_balance_details(chain_ID,chain_name,crediter_chain_ID,crediter_chain_name,product_ID,product_name,list_price,list_price_subtotal,cost_price,subtotal,amount,crediter_ID,crediter_name) values('"
                                + aaa[0]
                                + "','"
                                + aaa[1]
                                + "','"
                                + aaa1[0]
                                + "','"
                                + aaa1[1]
                                + "','"
                                + product_ID
                                + "','"
                                + product_name
                                + "','"
                                + list_price
                                + "','"
                                + list_price_subtotal
                                + "','"
                                + cost_price
                                + "','"
                                + cost_price_subtotal
                                + "','"
                                + amount
                                + "','"
                                + payer_ID
                                + "','"
                                + payer_name
                                + "')";
                        crm_db.executeUpdate(sql95);
                      }
                    }
                  }
                  String[] cost_pricen = request.getParameterValues("cost_price");
                  String[] list_pricen = request.getParameterValues("list_price");
                  String[] product_namen = request.getParameterValues("product_name");
                  String[] product_describen = request.getParameterValues("product_describe");
                  String[] amount_unitn = request.getParameterValues("amount_unit");
                  String[] typen = request.getParameterValues("type");
                  for (int i = 1; i < product_IDn.length; i++) {
                    StringTokenizer tokenTO3 = new StringTokenizer(list_pricen[i], ",");
                    String list_price = "";
                    while (tokenTO3.hasMoreTokens()) {
                      String list_price1 = tokenTO3.nextToken();
                      list_price += list_price1;
                    }
                    if (!amountn[i].equals("") && Double.parseDouble(amountn[i]) != 0) {
                      double list_price_subtotal =
                          Double.parseDouble(list_price) * Double.parseDouble(amountn[i]);
                      list_price_sum += list_price_subtotal;
                      double subtotal =
                          Double.parseDouble(cost_pricen[i]) * Double.parseDouble(amountn[i]);
                      cost_price_sum += subtotal;
                      demand_amount += Double.parseDouble(amountn[i]);
                      num++;
                      String sql1 =
                          "insert into stock_apply_pay_details(payer_chain_ID,payer_chain_name,sales_ID,sales_name,payer_ID,payer_name,payer_type,pay_ID,details_number,product_ID,product_name,product_describe,amount,amount_unit,list_price,list_price_subtotal,cost_price,subtotal,type) values ('"
                              + aaa1[0]
                              + "','"
                              + aaa1[1]
                              + "','"
                              + sales_ID
                              + "','"
                              + sales_name
                              + "','"
                              + payer_ID
                              + "','"
                              + payer_name
                              + "','销售赊货','"
                              + pay_ID
                              + "','"
                              + num
                              + "','"
                              + product_IDn[i]
                              + "','"
                              + product_namen[i]
                              + "','"
                              + product_describen[i]
                              + "','"
                              + amountn[i]
                              + "','"
                              + amount_unitn[i]
                              + "','"
                              + list_price
                              + "','"
                              + list_price_subtotal
                              + "','"
                              + cost_pricen[i]
                              + "','"
                              + subtotal
                              + "','"
                              + typen[i]
                              + "')";
                      stock_db.executeUpdate(sql1);
                      // **********************
                      if (rsList.size() == 0) {
                        if (typen[i].equals("物料") || typen[i].equals("外购商品")) {
                          String sql2 =
                              "insert into stock_pay_details(pay_ID,details_number,product_ID,product_name,type,list_price,list_price_subtotal,cost_price,subtotal,amount,unpay_amount,apply_manufacture_amount,apply_purchase_amount) values('"
                                  + stock_pay_ID
                                  + "','"
                                  + num
                                  + "','"
                                  + product_IDn[i]
                                  + "','"
                                  + product_namen[i]
                                  + "','"
                                  + typen[i]
                                  + "','"
                                  + list_price
                                  + "','"
                                  + list_price_subtotal
                                  + "','"
                                  + cost_pricen[i]
                                  + "','"
                                  + subtotal
                                  + "','"
                                  + amountn[i]
                                  + "','"
                                  + amountn[i]
                                  + "','0','"
                                  + amountn[i]
                                  + "')";
                          stock_db.executeUpdate(sql2);
                        } else if (typen[i].equals("商品")
                            || typen[i].equals("部件")
                            || typen[i].equals("委外部件")) {
                          String sql2 =
                              "insert into stock_pay_details(pay_ID,details_number,product_ID,product_name,type,list_price,list_price_subtotal,cost_price,subtotal,amount,unpay_amount,apply_manufacture_amount,apply_purchase_amount) values('"
                                  + stock_pay_ID
                                  + "','"
                                  + num
                                  + "','"
                                  + product_IDn[i]
                                  + "','"
                                  + product_namen[i]
                                  + "','"
                                  + typen[i]
                                  + "','"
                                  + list_price
                                  + "','"
                                  + list_price_subtotal
                                  + "','"
                                  + cost_pricen[i]
                                  + "','"
                                  + subtotal
                                  + "','"
                                  + amountn[i]
                                  + "','"
                                  + amountn[i]
                                  + "','"
                                  + amountn[i]
                                  + "','0')";
                          stock_db.executeUpdate(sql2);
                        }

                        String sql97 =
                            "select * from crm_salecredit_balance_details where crediter_ID='"
                                + payer_ID
                                + "' and product_ID='"
                                + product_IDn[i]
                                + "'";
                        ResultSet rs97 = crm_db.executeQuery(sql97);
                        if (rs97.next()) {
                          double balance_amount =
                              rs97.getDouble("amount") + Double.parseDouble(amountn[i]);
                          double balance_cost_price_subtotal =
                              rs97.getDouble("subtotal") + subtotal;
                          double balance_list_price_subtotal =
                              rs97.getDouble("list_price_subtotal") + list_price_subtotal;

                          String sql96 =
                              "update crm_salecredit_balance_details set amount='"
                                  + balance_amount
                                  + "',check_tag='1',subtotal='"
                                  + balance_cost_price_subtotal
                                  + "',list_price_subtotal='"
                                  + balance_list_price_subtotal
                                  + "' where crediter_ID='"
                                  + payer_ID
                                  + "' and product_ID='"
                                  + product_IDn[i]
                                  + "'";
                          crm_db.executeUpdate(sql96);
                        } else {
                          String[] aaa =
                              FileKind.getKind(
                                  (String) dbSession.getAttribute("unit_db_name"),
                                  "design_file",
                                  "product_ID",
                                  product_IDn[i]);
                          String sql95 =
                              "insert into crm_salecredit_balance_details(chain_ID,chain_name,crediter_chain_ID,crediter_chain_name,product_ID,product_name,list_price,list_price_subtotal,cost_price,subtotal,amount,crediter_ID,crediter_name) values('"
                                  + aaa[0]
                                  + "','"
                                  + aaa[1]
                                  + "','"
                                  + aaa1[0]
                                  + "','"
                                  + aaa1[1]
                                  + "','"
                                  + product_IDn[i]
                                  + "','"
                                  + product_namen[i]
                                  + "','"
                                  + list_price
                                  + "','"
                                  + list_price_subtotal
                                  + "','"
                                  + cost_pricen[i]
                                  + "','"
                                  + subtotal
                                  + "','"
                                  + amountn[i]
                                  + "','"
                                  + payer_ID
                                  + "','"
                                  + payer_name
                                  + "')";
                          crm_db.executeUpdate(sql95);
                        }
                      }
                      // ***************************
                    }
                  }
                  String sql =
                      "update stock_apply_pay set reason='"
                          + reason
                          + "',register='"
                          + register
                          + "',register_time='"
                          + register_time
                          + "',demand_return_time='"
                          + demand_return_time
                          + "',register_time='"
                          + register_time
                          + "',register='"
                          + register
                          + "',remark='"
                          + remark
                          + "',demand_amount='"
                          + demand_amount
                          + "',list_price_sum='"
                          + list_price_sum
                          + "',cost_price_sum='"
                          + cost_price_sum
                          + "',not_return_tag='"
                          + not_return_tag
                          + "' where pay_ID='"
                          + pay_ID
                          + "'";
                  stock_db.executeUpdate(sql);
                  if (flag) {
                    sql = "update stock_apply_pay set check_tag='1' where pay_ID='" + pay_ID + "'";
                    stock_db.executeUpdate(sql);
                    if (!vr.validata(
                        (String) dbSession.getAttribute("unit_db_name"),
                        "stock_pay",
                        "reasonexact",
                        pay_ID)) {
                      String sql4 =
                          "insert into stock_pay(pay_ID,reason,reasonexact,reasonexact_details,demand_amount,list_price_sum,cost_price_sum,register,register_time) values('"
                              + stock_pay_ID
                              + "','"
                              + reason
                              + "','"
                              + pay_ID
                              + "','"
                              + payer_name
                              + "','"
                              + demand_amount
                              + "','"
                              + list_price_sum
                              + "','"
                              + cost_price_sum
                              + "','"
                              + register
                              + "','"
                              + register_time
                              + "')";
                      stock_db.executeUpdate(sql4);
                    }

                    String sql98 = "select * from crm_file where customer_ID='" + payer_ID + "'";
                    ResultSet rs98 = crm_db.executeQuery(sql98);
                    if (rs98.next()) {
                      double salecredit_list_price_sum =
                          rs98.getDouble("salecredit_list_price_sum") + list_price_sum;
                      double salecredit_cost_price_sum =
                          rs98.getDouble("salecredit_cost_price_sum") + cost_price_sum;

                      String sql99 =
                          "update crm_file set credit_yes_or_not_tag='1',salecredit_list_price_sum='"
                              + salecredit_list_price_sum
                              + "',salecredit_cost_price_sum='"
                              + salecredit_cost_price_sum
                              + "' where customer_ID='"
                              + payer_ID
                              + "' ";
                      crm_db.executeUpdate(sql99);
                    }
                  } else {
                    sql = "update stock_apply_pay set check_tag='0' where pay_ID='" + pay_ID + "'";
                    stock_db.executeUpdate(sql);
                    Iterator ite = rsList.iterator();
                    while (ite.hasNext()) {
                      elem = (String[]) ite.next();
                      sql =
                          "insert into crm_workflow(config_id,object_ID,describe1,describe2) values ('"
                              + elem[0]
                              + "','"
                              + pay_ID
                              + "','"
                              + elem[1]
                              + "','"
                              + elem[2]
                              + "')";
                      crm_db.executeUpdate(sql);
                    }
                  }

                  response.sendRedirect("draft/crm/credit_ok.jsp?finished_tag=8");
                } else {

                  response.sendRedirect(
                      "draft/crm/credit_ok.jsp?finished_tag=7&pay_ID=" + pay_ID + "");
                }
              } catch (Exception ex) {
                ex.printStackTrace();
              }
            } else {

              response.sendRedirect("draft/crm/credit_ok.jsp?finished_tag=6&pay_ID=" + pay_ID + "");
            }
          } else {

            response.sendRedirect("draft/crm/credit_ok.jsp?finished_tag=9");
          }
        }
        stock_db.commit();
        crm_db.commit();
        stock_db.close();
        crm_db.close();
      } else {
        response.sendRedirect("error_conn.htm");
      }
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    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 {
      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("\r\n");
      out.write(
          "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
      out.write("<html ng-app=\"demo\">\r\n");
      out.write("<head>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
      out.write("<title>map</title>\r\n");
      out.write("<style rel='stylesheet'>\r\n");
      out.write("#container {\r\n");
      out.write("\twidth: 100%;\r\n");
      out.write("\theight: 400px;\r\n");
      out.write("}\r\n");
      out.write("</style>\r\n");
      out.write("<link rel='stylesheet'\r\n");
      out.write("\thref='");
      out.print(request.getContextPath());
      out.write("/public/bower_components/bootstrap/dist/css/bootstrap.min.css' />\r\n");
      out.write("</head>\r\n");
      out.write("<body>\r\n");
      out.write("\t<div class=\"container\" ng-controller=\"demoController\">\r\n");
      out.write("\t\t<div class=\"page-header\">\r\n");
      out.write("\t\t\t<h1>\r\n");
      out.write("\t\t\t\tGeely CSP<small>高德地图Demo</small>\r\n");
      out.write("\t\t\t</h1>\r\n");
      out.write("\t\t</div>\r\n");
      out.write("\t\t<div class=\"container-fluid\">\r\n");
      out.write("\t\t\t<div class=\"row\">\r\n");
      out.write("\t\t\t\t<div class=\"col-md-8\">\r\n");
      out.write("\t\t\t\t\t<div class=\"input-group\">\r\n");
      out.write(
          "\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" placeholder=\"车辆ID\">\r\n");
      out.write("\t\t\t\t\t\t<span class=\"input-group-btn\">\r\n");
      out.write(
          "\t\t\t\t\t\t\t<button class=\"btn btn-default\" type=\"button\">Search</button>\r\n");
      out.write("\t\t\t\t\t\t</span>\r\n");
      out.write("\t\t\t\t\t</div>\r\n");
      out.write("\t\t\t\t\t<hr />\r\n");
      out.write("\t\t\t\t\t<div id=\"container\"></div>\r\n");
      out.write("\t\t\t\t</div>\r\n");
      out.write("\t\t\t\t<div class=\"col-md-4\">\r\n");
      out.write("\t\t\t\t\t<div class=\"panel-group\" id=\"accordion\" role=\"tablist\"\r\n");
      out.write("\t\t\t\t\t\taria-multiselectable=\"true\">\r\n");
      out.write("\t\t\t\t\t\t<div class=\"panel panel-default\">\r\n");
      out.write("\t\t\t\t\t\t\t<div class=\"panel-heading\" role=\"tab\" id=\"headingOne\">\r\n");
      out.write("\t\t\t\t\t\t\t\t<h4 class=\"panel-title\">\r\n");
      out.write("\t\t\t\t\t\t\t\t\t<a role=\"button\" data-toggle=\"collapse\"\r\n");
      out.write("\t\t\t\t\t\t\t\t\t\tdata-parent=\"#accordion\" href=\"#collapseOne\"\r\n");
      out.write("\t\t\t\t\t\t\t\t\t\taria-expanded=\"true\" aria-controls=\"collapseOne\">\r\n");
      out.write("\t\t\t\t\t\t\t\t\t\t车辆信息 </a>\r\n");
      out.write("\t\t\t\t\t\t\t\t</h4>\r\n");
      out.write("\t\t\t\t\t\t\t</div>\r\n");
      out.write("\t\t\t\t\t\t\t<div id=\"collapseOne\" class=\"panel-collapse collapse in\"\r\n");
      out.write("\t\t\t\t\t\t\t\trole=\"tabpanel\" aria-labelledby=\"headingOne\">\r\n");
      out.write(
          "\t\t\t\t\t\t\t\t<div class=\"panel-body\" ng-bind=\"data.info.carInfo\"></div>\r\n");
      out.write("\t\t\t\t\t\t\t</div>\r\n");
      out.write("\t\t\t\t\t\t</div>\r\n");
      out.write("\t\t\t\t\t\t<div class=\"panel panel-default\">\r\n");
      out.write("\t\t\t\t\t\t\t<div class=\"panel-heading\" role=\"tab\" id=\"headingTwo\">\r\n");
      out.write("\t\t\t\t\t\t\t\t<h4 class=\"panel-title\">\r\n");
      out.write(
          "\t\t\t\t\t\t\t\t\t<a class=\"collapsed\" role=\"button\" data-toggle=\"collapse\"\r\n");
      out.write("\t\t\t\t\t\t\t\t\t\tdata-parent=\"#accordion\" href=\"#collapseTwo\"\r\n");
      out.write("\t\t\t\t\t\t\t\t\t\taria-expanded=\"false\" aria-controls=\"collapseTwo\">\r\n");
      out.write("\t\t\t\t\t\t\t\t\t\t街道信息 </a>\r\n");
      out.write("\t\t\t\t\t\t\t\t</h4>\r\n");
      out.write("\t\t\t\t\t\t\t</div>\r\n");
      out.write("\t\t\t\t\t\t\t<div id=\"collapseTwo\" class=\"panel-collapse collapse\"\r\n");
      out.write("\t\t\t\t\t\t\t\trole=\"tabpanel\" aria-labelledby=\"headingTwo\">\r\n");
      out.write(
          "\t\t\t\t\t\t\t\t<div class=\"panel-body\" ng-bind=\"data.info.streetInfo\"></div>\r\n");
      out.write("\t\t\t\t\t\t\t</div>\r\n");
      out.write("\t\t\t\t\t\t</div>\r\n");
      out.write("\t\t\t\t\t\t<div class=\"panel panel-default\">\r\n");
      out.write("\t\t\t\t\t\t\t<div class=\"panel-heading\" role=\"tab\" id=\"headingThree\">\r\n");
      out.write("\t\t\t\t\t\t\t\t<h4 class=\"panel-title\">\r\n");
      out.write(
          "\t\t\t\t\t\t\t\t\t<a class=\"collapsed\" role=\"button\" data-toggle=\"collapse\"\r\n");
      out.write("\t\t\t\t\t\t\t\t\t\tdata-parent=\"#accordion\" href=\"#collapseThree\"\r\n");
      out.write("\t\t\t\t\t\t\t\t\t\taria-expanded=\"false\" aria-controls=\"collapseThree\">\r\n");
      out.write("\t\t\t\t\t\t\t\t\t\t事故详细 </a>\r\n");
      out.write("\t\t\t\t\t\t\t\t</h4>\r\n");
      out.write("\t\t\t\t\t\t\t</div>\r\n");
      out.write("\t\t\t\t\t\t\t<div id=\"collapseThree\" class=\"panel-collapse collapse\"\r\n");
      out.write("\t\t\t\t\t\t\t\trole=\"tabpanel\" aria-labelledby=\"headingThree\">\r\n");
      out.write(
          "\t\t\t\t\t\t\t\t<div class=\"panel-body\" ng-bind=\"data.info.accidentInfo\"></div>\r\n");
      out.write("\t\t\t\t\t\t\t</div>\r\n");
      out.write("\t\t\t\t\t\t</div>\r\n");
      out.write("\t\t\t\t\t</div>\r\n");
      out.write("\t\t\t\t</div>\r\n");
      out.write("\t\t\t</div>\r\n");
      out.write("\t\t</div>\r\n");
      out.write("\t</div>\r\n");
      out.write("\r\n");
      out.write("</body>\r\n");
      out.write(
          "<script type=\"text/javascript\" src=\"http://webapi.amap.com/maps?v=1.3&key=8624195bc8afebd5022bde7ec8306e05\"></script>\r\n");
      out.write("<script type=\"text/javascript\" src=\"");
      out.print(request.getContextPath());
      out.write("/public/bower_components/jquery/dist/jquery.min.js\"></script>\r\n");
      out.write("<script type=\"text/javascript\" src=\"");
      out.print(request.getContextPath());
      out.write("/public/bower_components/angular/angular.min.js\"></script>\r\n");
      out.write("<script type=\"text/javascript\" src=\"");
      out.print(request.getContextPath());
      out.write("/public/bower_components/bootstrap/dist/js/bootstrap.min.js\"></script>\r\n");
      out.write("<script type=\"text/javascript\" src=\"");
      out.print(request.getContextPath());
      out.write("/public/js/demo/demo.js\"></script>\r\n");
      out.write("</html>");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    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 {
      response.setContentType("text/html");
      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("\r\n\r\n");

      final DisplayState theDisplayState = (DisplayState) request.getAttribute(MasterServlet.STATE);
      final Frame frame = (Frame) request.getAttribute(AbstractChip.FRAME_KEY);

      /*
       //to be definitive NOT serializable
      InputStream noser = (InputStream)session.getAttribute( "NOT_SERIALIZABLE");
      if( noser==null )
      {
      	session.setAttribute( "NOT_SERIALIZABLE", new ByteArrayInputStream( new byte[0] ));
      }
      */

      out.write('\r');
      out.write('\n');

      final AbstractItemTreeNodeChip theChip =
          (AbstractItemTreeNodeChip) request.getAttribute(AbstractChip.CHIP_KEY);

      out.write("\r\n<input type=\"hidden\" name=\"");
      out.print(theChip.getEventID(AbstractTreeNodeChip.EDIT));
      out.write("\" value=\"");
      out.print(AbstractChip.FALSE);
      out.write(
          "\" />\r\n<table class=\"abstractItemTreeNodeChip\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t<tr>\r\n\t\t<td class=\"aitncIcon\">\r\n\t\t\t<div onclick=\"document.editorForm.elements['");
      out.print(theChip.getEventID(AbstractTreeNodeChip.EDIT));
      out.write("'].value='");
      out.print(AbstractChip.TRUE);
      out.write("';setScrollAndSubmit();\">\r\n\t\t\t\t<img src=\"");
      out.print(theChip.getIcon());
      out.write(
          "\" border=\"0\">\r\n\t\t\t</div>\r\n\t\t</td>\r\n\t\t<td class=\"aitncName\">\r\n\t\t\t<div onclick=\"document.editorForm.elements['");
      out.print(theChip.getEventID(AbstractTreeNodeChip.EDIT));
      out.write("'].value='");
      out.print(AbstractChip.TRUE);
      out.write("';setScrollAndSubmit();\">\r\n\t\t\t\t");
      out.print(theChip.getName());
      out.write("\r\n\t\t\t</div>\r\n\t\t</td>\r\n\t</tr>\r\n\t");

      if (theChip.isExpanded()) {
        for (final Iterator it = theChip.getAllChildren().iterator(); it.hasNext(); ) {
          final AbstractTreeNodeChip child = (AbstractTreeNodeChip) it.next();

          out.write("\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"aitncTreeIMG\" background=\"");
          out.print(it.hasNext() ? "images/vert.gif" : "");
          out.write("\">\r\n\t\t\t\t\t\t\t");

          if (child.hasChildren()) {
            if (child.isExpanded()) {

              out.write("<input type=\"hidden\" name=\"");
              out.print(child.getEventID(AbstractTreeNodeChip.COLLAPSE));
              out.write("\" value=\"");
              out.print(AbstractChip.FALSE);
              out.write("\" /><div onclick=\"document.editorForm.elements['");
              out.print(child.getEventID(AbstractTreeNodeChip.COLLAPSE));
              out.write("'].value='");
              out.print(AbstractChip.TRUE);
              out.write("';setScrollAndSubmit();\">");

              if (it.hasNext()) {

                out.write("<img src=\"images/minus.gif\"></td>");

              } else {

                out.write("<img src=\"images/minusend.gif\"></td>");
              }

              out.write("</div>");

            } else {

              out.write("<input type=\"hidden\" name=\"");
              out.print(child.getEventID(AbstractTreeNodeChip.EXPAND));
              out.write("\" value=\"");
              out.print(AbstractChip.FALSE);
              out.write("\" /><div onclick=\"document.editorForm.elements['");
              out.print(child.getEventID(AbstractTreeNodeChip.EXPAND));
              out.write("'].value='");
              out.print(AbstractChip.TRUE);
              out.write("';setScrollAndSubmit();\">");

              if (it.hasNext()) {

                out.write("<img src=\"images/plus.gif\"></td>");

              } else {

                out.write("<img src=\"images/plusend.gif\"></td>");
              }

              out.write("</div>");
            }
          } else {
            if (it.hasNext()) {

              out.write("<img src=\"images/horiz.gif\"></td>");

            } else {

              out.write("<img src=\"images/end.gif\"></td>");
            }
          }

          out.write("\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td class=\"aitncContext\">");
          child.render(pageContext);
          out.write("</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t");
        }
      }

      out.write("\r\n</table>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            out.clearBuffer();
          } catch (java.io.IOException e) {
          }
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else log(t.getMessage(), t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }