public static String loadDriver() { String sErr = ""; try { java.sql.DriverManager.registerDriver( (java.sql.Driver) (Class.forName(DBDriver).newInstance())); } catch (Exception e) { sErr = e.toString(); } return (sErr); }
/** * Method called at start of is_summary Tag * * @return EVAL_BODY if current message while walking a thread is greater than or equal to the * users message_depth but less than the users thread_depth or SKIP_BODY */ public final int doStartTag() throws JspException { // Find the parent walk ta WalkTag wt = null; try { wt = (WalkTag) this.findAncestorWithClass(this, Class.forName("com.Yasna.forum.tags.WalkTag")); } catch (Exception e) { return SKIP_BODY; } if (wt != null && wt.isSummaryMessage()) return EVAL_BODY_INCLUDE; return SKIP_BODY; }
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> <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\">×</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); } }
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("\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"); org.jivesoftware.util.WebManager webManager = null; synchronized (_jspx_page_context) { webManager = (org.jivesoftware.util.WebManager) _jspx_page_context.getAttribute("webManager", PageContext.PAGE_SCOPE); if (webManager == null) { webManager = new org.jivesoftware.util.WebManager(); _jspx_page_context.setAttribute("webManager", webManager, PageContext.PAGE_SCOPE); } } out.write('\r'); out.write('\n'); webManager.init(request, response, session, application, out); boolean save = request.getParameter("save") != null; boolean success = request.getParameter("success") != null; String persistentRosterParam = request.getParameter("persistentEnabled"); boolean persistentRoster = persistentRosterParam == null ? false : persistentRosterParam.equals("true"); String ignoreSubdomainsParam = request.getParameter("ignoreSubdomains"); boolean ignnoreSubdomains = ignoreSubdomainsParam == null ? false : ignoreSubdomainsParam.equals("true"); String blockPresencesParam = request.getParameter("blockPresences"); boolean blockPresences = blockPresencesParam == null ? false : blockPresencesParam.equals("true"); String sparkdiscoParam = request.getParameter("sparkDiscoInfo"); boolean sparkDiscoInfo = sparkdiscoParam == null ? false : sparkdiscoParam.equals("true"); String iqLastFilterPram = request.getParameter("iqLastFilter"); boolean iqLastFilter = iqLastFilterPram == null ? false : iqLastFilterPram.equals("true"); String mucFilterParam = request.getParameter("mucFilter"); boolean mucFilter = mucFilterParam == null ? false : mucFilterParam.equals("true"); String gajimBroadcastParam = request.getParameter("gajimBroadcast"); boolean gajimBroadcast = gajimBroadcastParam == null ? false : gajimBroadcastParam.equals("true"); String[] componentsEnabled = request.getParameterValues("enabledComponents[]"); PermissionManager _pmanager = new PermissionManager(); DatabaseManager _db; Map<String, String> errors = new HashMap<String, String>(); if (save) { for (String property : JiveGlobals.getPropertyNames("plugin.remoteroster.jids")) { JiveGlobals.deleteProperty(property); } if (componentsEnabled != null) { for (int i = 0; i < componentsEnabled.length; i++) { JiveGlobals.setProperty("plugin.remoteroster.jids." + componentsEnabled[i], "true"); String group = request.getParameter("input_group." + componentsEnabled[i]); if (group != null) { _pmanager.setGroupForGateway(componentsEnabled[i], group); } } } JiveGlobals.setProperty( "plugin.remoteroster.persistent", (persistentRoster ? "true" : "false")); JiveGlobals.setProperty( "plugin.remoteroster.blockPresences", (blockPresences ? "true" : "false")); JiveGlobals.setProperty( "plugin.remoteroster.sparkDiscoInfo", (sparkDiscoInfo ? "true" : "false")); JiveGlobals.setProperty( "plugin.remoteroster.iqLastFilter", (iqLastFilter ? "true" : "false")); JiveGlobals.setProperty("plugin.remoteroster.mucFilter", (mucFilter ? "true" : "false")); JiveGlobals.setProperty( "plugin.remoteroster.gajimBroadcast", (gajimBroadcast ? "true" : "false")); JiveGlobals.setProperty( "plugin.remoteroster.ignoreSubdomains", (ignnoreSubdomains ? "true" : "false")); response.sendRedirect("rr-main.jsp?success=true"); return; } // Get the session manager SessionManager sessionManager = webManager.getSessionManager(); Collection<ComponentSession> sessions = sessionManager.getComponentSessions(); _db = DatabaseManager.getInstance(); out.write( "\r\n\r\n<html>\r\n<head>\r\n<title>Gojara Settings</title>\r\n<link href=\"./css/rr.css\" rel=\"stylesheet\" type=\"text/css\">\r\n<script src=\"./js/http.js\" type=\"text/javascript\"></script>\r\n<script src=\"./js/jquery.js\" type=\"text/javascript\"></script>\r\n<script src=\"./js/rr.js\" type=\"text/javascript\"></script>\r\n<script src=\"./js/jquery.sparkline.js\" type=\"text/javascript\"></script>\r\n<script src=\"./js/jquery.horiz-bar-graph.js\" type=\"text/javascript\"></script>\r\n<!--[if lte IE 8]><script language=\"javascript\" type=\"text/javascript\" src=\"./js/excanvas.min.js\"></script><![endif]-->\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"./js/jquery.flot.js\"></script>\r\n<script language=\"javascript\" type=\"text/javascript\" src=\"./js/jquery.flot.pie.js\"></script>\r\n\r\n<meta name=\"pageID\" content=\"remoteRoster\" />\r\n<meta name=\"helpPage\" content=\"\" />\r\n\r\n</head>\r\n<body>\r\n\r\n\t<p>Any components configured here will allow the external component associated with them full control over their\r\n\t\tdomain within any user's roster. Before enabling Remote Roster Management support for an external component, first\r\n"); out.write( "\t\tconnect it like you would any external component. Once it has connected and registered with Openfire, it's JID should\r\n\t\tshow up below and you can enable Remote Roster support.</p>\r\n\r\n\t"); if (success) { out.write( "\r\n\r\n\t<div class=\"jive-success\">\r\n\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n\t\t\t<tbody>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"jive-icon\"><img src=\"images/success-16x16.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"\"></td>\r\n\t\t\t\t\t<td class=\"jive-icon-label\">Settings saved!</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</tbody>\r\n\t\t</table>\r\n\t</div>\r\n\t<br>\r\n\r\n\t"); } else if (errors.size() > 0) { out.write( "\r\n\r\n\t<div class=\"jive-error\">\r\n\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n\t\t\t<tbody>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"jive-icon\"><img src=\"images/error-16x16.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"\"></td>\r\n\t\t\t\t\t<td class=\"jive-icon-label\">Error saving settings!</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</tbody>\r\n\t\t</table>\r\n\t</div>\r\n\t<br>\r\n\r\n\t"); } out.write( "\r\n\r\n\t<form action=\"rr-main.jsp?save\" method=\"post\">\r\n\r\n\t\t<div class=\"jive-contentBoxHeader\">Connected Gateway Components</div>\r\n\t\t<div class=\"jive-contentBox\">\r\n\r\n\t\t\t<p>Select which components you want to enable remote roster on:</p>\r\n\t\t\t"); boolean gatewayFound = false; int i = 0; for (ComponentSession componentSession : sessions) { if (!componentSession.getExternalComponent().getCategory().equals("gateway")) { continue; } gatewayFound = true; long incoming = componentSession.getNumClientPackets(); long outgoing = componentSession.getNumServerPackets(); long both = incoming + outgoing; int incomingPercent = (int) (incoming * 100 / both); int outgoingPercent = (int) (outgoing * 100 / both); out.write( "\r\n\t\t\t<table class=\"gatewayHeader\">\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"gatewayCheckbox\"><input type=\"checkbox\" name=\"enabledComponents[]\"\r\n\t\t\t\t\t\t\tvalue=\""); out.print(componentSession.getExternalComponent().getInitialSubdomain()); out.write("\"\r\n\t\t\t\t\t\t\t"); out.print( JiveGlobals.getBooleanProperty( "plugin.remoteroster.jids." + componentSession.getExternalComponent().getInitialSubdomain(), false) ? "checked=\"checked\"" : ""); out.write(" />\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td class=\"gatewayName\">"); out.print(componentSession.getExternalComponent().getName()); out.write( "</td>\r\n\t\t\t\t\t\t<td class=\"gatewayIcons\"><img src=\"images/log-16x16.png\" onclick=\"slideToggle('#logs"); out.print(i); out.write( "')\"><img\r\n\t\t\t\t\t\t\tsrc=\"images/permissions-16x16.png\" id=\"showPermissions\" onclick=\"slideToggle('#permission"); out.print(i); out.write( "')\"><img\r\n\t\t\t\t\t\t\tsrc=\"images/info-16x16.png\" id=\"showConfig\" onclick=\"slideToggle('#config"); out.print(i); out.write( "')\"></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t\t<div id=\"config"); out.print(i); out.write( "\" class=\"slider\">\r\n\t\t\t\t<div class=\"sildeHeader\">Information</div>\r\n\t\t\t\t<table class=\"configTable\">\r\n\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t<tr id=\"logodd\">\r\n\t\t\t\t\t\t\t<td width=\"200px\">Domain:</td>\r\n\t\t\t\t\t\t\t<td>"); out.print(componentSession.getExternalComponent().getInitialSubdomain()); out.write( "</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr id=\"logeven\">\r\n\t\t\t\t\t\t\t<td>Status:</td>\r\n\t\t\t\t\t\t\t<td>Online</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr id=\"logodd\">\r\n\t\t\t\t\t\t\t<td>Packages Send/Received:</td>\r\n\t\t\t\t\t\t\t<td><dl class=\"browser-data\" title=\"\">\r\n\t\t\t\t\t\t\t\t\t<dt>Incoming</dt>\r\n\t\t\t\t\t\t\t\t\t<dd>"); out.print(incomingPercent); out.write("</dd>\r\n\t\t\t\t\t\t\t\t\t<dt>Outgoing</dt>\r\n\t\t\t\t\t\t\t\t\t<dd>"); out.print(outgoingPercent); out.write( "</dd>\r\n\t\t\t\t\t\t\t\t</dl></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</tbody>\r\n\t\t\t\t</table>\r\n\t\t\t</div>\r\n\t\t\t<div id=\"permission"); out.print(i); out.write( "\" class=\"slider\">\r\n\t\t\t\t<div class=\"sildeHeader\">Access control</div>\r\n\t\t\t\t<table class=\"groupTable\">\r\n\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t<tr id=\"loghead\">\r\n\t\t\t\t\t\t\t<td colspan=\"3\">You can limit the access to the external component to an existing group</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td class=\"permissionTableColumn\">Groupname:</td>\r\n\t\t\t\t\t\t\t<td><input class=\"groupInput\" type=\"text\" id=\"groupSearch"); out.print(i); out.write("\"\r\n\t\t\t\t\t\t\t\tname=\"input_group."); out.print(componentSession.getExternalComponent().getInitialSubdomain()); out.write("\" alt=\"Find Groups\"\r\n\t\t\t\t\t\t\t\tonkeyup=\"searchSuggest('"); out.print(i); out.write("');\" autocomplete=\"off\"\r\n\t\t\t\t\t\t\t\tvalue=\""); out.print( _pmanager.getGroupForGateway( componentSession.getExternalComponent().getInitialSubdomain())); out.write("\">\r\n\t\t\t\t\t\t\t\t<div id=\"search_suggest"); out.print(i); out.write( "\"></div></td>\r\n\t\t\t\t\t\t\t<td style=\"vertical-align: top;\">\r\n\t\t\t\t\t\t\t\t<div class=\"ajaxloading\" id=\"ajaxloading"); out.print(i); out.write( "\"></div>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</tbody>\r\n\t\t\t\t</table>\r\n\t\t\t</div>\r\n\t\t\t<div id=\"logs"); out.print(i); out.write("\" class=\"slider\">\r\n\t\t\t\t"); int iqs = _db.getPacketCount( componentSession.getExternalComponent().getInitialSubdomain(), Class.forName("org.xmpp.packet.IQ")); int msgs = _db.getPacketCount( componentSession.getExternalComponent().getInitialSubdomain(), Class.forName("org.xmpp.packet.Message")); int rosters = _db.getPacketCount( componentSession.getExternalComponent().getInitialSubdomain(), Class.forName("org.xmpp.packet.Roster")); int presences = _db.getPacketCount( componentSession.getExternalComponent().getInitialSubdomain(), Class.forName("org.xmpp.packet.Presence")); out.write( "\r\n\t\t\t\t<div class=\"sildeHeader\">Logs & Statistics</div>\r\n\r\n\t\t\t\t<table class=\"logtable\">\r\n\t\t\t\t\t<tfoot>\r\n\t\t\t\t\t\t<tr id=\"logfoot\">\r\n\t\t\t\t\t\t\t<td colspan=\"2\">Packages being logged for "); out.print(JiveGlobals.getIntProperty("plugin.remoteroster.log.cleaner.minutes", 60)); out.write( "\r\n\t\t\t\t\t\t\t\tminutes\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td><a style=\"float: right;\"\r\n\t\t\t\t\t\t\t\tonClick=\"window.open('liveStats.jsp?component="); out.print(componentSession.getExternalComponent().getInitialSubdomain()); out.write( "','mywindow','width=1200,height=700')\">Show\r\n\t\t\t\t\t\t\t\t\trealtime Log</a>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</tfoot>\r\n\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t<tr id=\"loghead\">\r\n\t\t\t\t\t\t\t<td width=\"200px\">Paket type</td>\r\n\t\t\t\t\t\t\t<td width=\"100px\">Number</td>\r\n\t\t\t\t\t\t\t<td></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr id=\"logodd\">\r\n\t\t\t\t\t\t\t<td>IQ</td>\r\n\t\t\t\t\t\t\t<td id=\"logiq"); out.print(i); out.write('"'); out.write('>'); out.print(iqs); out.write("</td>\r\n\t\t\t\t\t\t\t<td rowspan=\"5\"><div id=\"pie"); out.print(i); out.write( "\" class=\"graph\"></div></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr id=\"logeven\">\r\n\t\t\t\t\t\t\t<td>Messages</td>\r\n\t\t\t\t\t\t\t<td id=\"logmsg"); out.print(i); out.write('"'); out.write('>'); out.print(msgs); out.write( "</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr id=\"logodd\">\r\n\t\t\t\t\t\t\t<td>Roster</td>\r\n\t\t\t\t\t\t\t<td id=\"logroster"); out.print(i); out.write('"'); out.write('>'); out.print(rosters); out.write( "</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr id=\"logeven\">\r\n\t\t\t\t\t\t\t<td>Presence</td>\r\n\t\t\t\t\t\t\t<td id=\"logpresence"); out.print(i); out.write('"'); out.write('>'); out.print(presences); out.write( "</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr id=\"logodd\">\r\n\t\t\t\t\t\t\t<td><span style=\"font-weight: bold;\">Total:</span></td>\r\n\t\t\t\t\t\t\t<td><span style=\"font-weight: bold;\">"); out.print(iqs + msgs + rosters + presences); out.write( "</span></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</tbody>\r\n\t\t\t\t</table>\r\n\r\n\t\t\t</div>\r\n\r\n\r\n\t\t\t"); ++i; } out.write("\r\n\t\t\t"); if (!gatewayFound) { out.write( "\r\n\t\t\t<span style=\"font-weight: bold\">No connected external gateway components found.</span>\r\n\t\t\t"); } out.write( "\r\n\t\t</div>\r\n\t\t\r\n\t\t\r\n<div class=\"jive-contentBoxHeader\">General Options</div>\r\n<div class=\"jive-contentBox\">\r\n <table cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"100%\">\r\n <tbody>\r\n <tr valign=\"top\">\r\n <td width=\"100%\">\r\n <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n <tbody>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><input type=\"checkbox\" name=\"persistentEnabled\" id=\"GO1\" value=\"true\"\r\n\t\t\t\t\t\t"); out.print( JiveGlobals.getBooleanProperty("plugin.remoteroster.persistent", false) ? "checked=\"checked\"" : ""); out.write( " />\r\n\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t<td><label for=\"GO1\">Enable persistent Roster</label></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td />\r\n\t\t\t\t\t<td align=\"left\" style=\"font-size: -3; color: grey\">When Persistent-Roster is enabled, contacts will be saved to database and\r\n\t\t\t\t\tno contacts will be deleted\tby GoJara automatically.<br>\t\t\t\t\t\r\n\t\t\t\t\tWhen Persistent-Roster is disabled, contacts will not be saved to database and \r\n\t\t\t\t\tGoJara will automatically delete all Legacy-RosterItems from the OF-Roster of a User upon logout.<br>Enable this if you want to store Gateway contacts in DB. </td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><input type=\"checkbox\" name=\"mucFilter\" id=\"GO2\" value=\"true\"\r\n\t\t\t\t\t\t"); out.print( JiveGlobals.getBooleanProperty("plugin.remoteroster.mucFilter", false) ? "checked=\"checked\"" : ""); out.write( " />\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t<td><label for=\"GO2\">Only allow internal Jabber Conferences</label></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td />\r\n\t\t\t\t\t<td align=\"left\" style=\"font-size: -3; color: grey\">Spectrum might add MUC(Multi User Chat) to supported features\r\n\t\t\t\t\t of some Transports. If this should not be allowed, because only internal Jabber Conferences should be used, GoJara\r\n\t\t\t\t\t can remove these.</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><input type=\"checkbox\" name=\"ignoreSubdomains\" id=\"GO3\" value=\"true\"\r\n\t\t\t\t\t\t"); out.print( JiveGlobals.getBooleanProperty("plugin.remoteroster.ignoreSubdomains", true) ? "checked=\"checked\"" : ""); out.write( " />\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t<td><label for=\"GO2\">Do not add Subdomains to Roster</label></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td />\r\n\t\t\t\t\t<td align=\"left\" style=\"font-size: -3; color: grey\">If you do not want the gateway itself to show up as a contact on your roster,\r\n\t\t\t\t\tenable this (only happens on registration).\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n\r\n\t\t<br /> <br />\r\n\t\t<div class=\"jive-contentBoxHeader\">Client specific options</div>\r\n\t\t<div class=\"jive-contentBox\">\r\n\t\t\t<table cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"100%\">\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t\t<td width=\"1%\" nowrap class=\"c1\">Spark:</td>\r\n\t\t\t\t\t\t<td width=\"99%\">\r\n\t\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n\t\t\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td><input type=\"checkbox\" name=\"sparkDiscoInfo\" id=\"SDI\" value=\"true\"\r\n\t\t\t\t\t\t\t\t\t\t\t"); out.print( JiveGlobals.getBooleanProperty("plugin.remoteroster.sparkDiscoInfo", false) ? "checked=\"checked\"" : ""); out.write( " />\r\n\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t<td><label for=\"SDI\"> Support jabber:iq:registered feature</label></td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td />\r\n\t\t\t\t\t\t\t\t\t\t<td align=\"left\" style=\"font-size: -3; color: grey\">If you use Spark clients within your network, it\r\n\t\t\t\t\t\t\t\t\t\t\tmight be necessary to modify the service discovery packets between Spark and the external component. If you\r\n\t\t\t\t\t\t\t\t\t\t\tcheck this RemoteRoster will add the feature \"jabber:iq:registered\" to the disco#info to indicate that the\r\n\t\t\t\t\t\t\t\t\t\t\tClient is registered with the external component.</td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td><input type=\"checkbox\" name=\"iqLastFilter\" id=\"SDI2\" value=\"true\"\r\n\t\t\t\t\t\t\t\t\t\t\t"); out.print( JiveGlobals.getBooleanProperty("plugin.remoteroster.iqLastFilter", false) ? "checked=\"checked\"" : ""); out.write( " />\r\n\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t<td><label for=\"SDI\">Reply to jabber:iq:last </label></td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td />\r\n\t\t\t\t\t\t\t\t\t\t<td align=\"left\" style=\"font-size: -3; color: grey\">Some clients try to check how long a contact is already offline.\r\n\t\t\t\t\t\t\t\t\t\t This feature is not supported by spectrum so it won't response to this IQ stanza. To prevent the client from waiting\r\n\t\t\t\t\t\t\t\t\t\t for a response we could answer with a service-unavailable message as described in XEP-12.</td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td><input type=\"checkbox\" name=\"blockPresences\" id=\"SDI3\" value=\"true\"\r\n\t\t\t\t\t\t\t\t\t\t\t"); out.print( JiveGlobals.getBooleanProperty("plugin.remoteroster.blockPresences", true) ? "checked=\"checked\"" : ""); out.write( " />\r\n\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t<td><label for=\"SDI\">Block presence pushing to rosterItems except gateway</label></td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td />\r\n\t\t\t\t\t\t\t\t\t\t<td align=\"left\" style=\"font-size: -3; color: grey\">Openfire automatically pushes Presences to every Item on your Roster.\r\n\t\t\t\t\t\t\t\t\t\tFor Spark, this means that roster items which are imported through gateway will trigger automatic login, even if you configured\r\n\t\t\t\t\t\t\t\t\t\tSpark to not connect to these gateways on Startup.<br>\r\n\t\t\t\t\t\t\t\t\t\tBlock Presences if you use Spark and do not want to autoconnect.</td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr valign=\"top\">\r\n\t\t\t\t\t\t<td width=\"1%\" nowrap class=\"c1\">Gajim:</td>\r\n\t\t\t\t\t\t<td width=\"99%\">\r\n\t\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n\t\t\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td><input type=\"checkbox\" name=\"gajimBroadcast\" id=\"gajimBroadcast\" value=\"true\"\r\n\t\t\t\t\t\t\t\t\t\t\t"); out.print( JiveGlobals.getBooleanProperty("plugin.remoteroster.gajimBroadcast", false) ? "checked=\"checked\"" : ""); out.write( " />\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t<td><label for=\"gajimBroadcast\">Push available presence on startup</label></td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td />\r\n\t\t\t\t\t\t\t\t\t\t<td align=\"left\" style=\"font-size: -3; color: grey\">Enable this if Gojara should push available presences to\r\n\t\t\t\t\t\t\t\t\t\ttransports from your roster on startup. If disabled, you may have to manually send an available presence to the specific \r\n\t\t\t\t\t\t\t\t\t\ttransport to connect to it.<br>Not needed if you add Subdomains to roster + disabled presence blocking.</td>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t</div>\r\n\r\n\r\n\t\t<input type=\"submit\" name=\"save\" value=\"Save Settings\" />\r\n\t</form>\r\n\r\n</body>\r\n</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( final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { final java.lang.String _jspx_method = request.getMethod(); if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method) && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) { response.sendError( HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD"); return; } final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final javax.servlet.ServletContext application; final javax.servlet.ServletConfig config; javax.servlet.jsp.JspWriter out = null; final java.lang.Object page = this; javax.servlet.jsp.JspWriter _jspx_out = null; javax.servlet.jsp.PageContext _jspx_page_context = null; try { response.setContentType("text/html"); 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 username = ""; if (session.getAttribute("login") != null) { username = session.getAttribute("login").toString(); } else { out.println("Invalid session! You must log back into the system."); return; } String outputMsg = "TODO"; ResultSet employeeRevRes = null; String JDBC_DRIVER = "com.mysql.jdbc.Driver"; String DB_URL = "jdbc:mysql://localhost:3306/SilkRoad 5.0"; String USER = "******"; String PASS = "******"; Statement stmt = null; String sql = null; Connection conn = null; CallableStatement cs = null; try { // Register JDBC driver Class.forName(JDBC_DRIVER).newInstance(); // Open a connection conn = java.sql.DriverManager.getConnection(DB_URL, USER, PASS); System.out.println("HERE"); cs = conn.prepareCall("call GetEmployeeRevenues()"); cs.execute(); employeeRevRes = cs.getResultSet(); // TODO. Error handling out.write("\r\n"); out.write(" <html lang=\"en\">\r\n"); out.write(" <head>\r\n"); out.write(" <meta charset=\"utf-8\">\r\n"); out.write(" <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n"); out.write( " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n"); out.write( " <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->\r\n"); out.write(" <title>Silk Road 5.0</title>\r\n"); out.write(" <!-- Bootstrap -->\r\n"); out.write(" <link href=\"css/bootstrap.min.css\" rel=\"stylesheet\">\r\n"); out.write(" "); out.write("\r\n"); out.write( " <link href=\"css/responsive.bootstrap.min.css\" rel=\"stylesheet\" type=\"text/css\">\r\n"); out.write( " <link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.5/css/bootstrap-dialog.min.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n"); out.write(" <!-- Our own custom css -->\r\n"); out.write( " <link href=\"css/stylesheet.css\" rel=\"stylesheet\" type=\"text/css\">\r\n"); out.write( " <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->\r\n"); out.write( " <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\r\n"); out.write(" <!--[if lt IE 9]>\r\n"); out.write( " <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\r\n"); out.write( " <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\r\n"); out.write(" <![endif]-->\r\n"); out.write(" <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->\r\n"); out.write(" <script src=\"js/jquery-1.11.3.min.js\"></script>\r\n"); out.write(" <script src=\"js/jquery.validate.js\"></script>\r\n"); out.write(" "); out.write("\r\n"); out.write( " <!-- Include all compiled plugins (below), or include individual files as needed -->\r\n"); out.write(" <script src=\"js/bootstrap.min.js\"></script>\r\n"); out.write( " <script src=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.5/js/bootstrap-dialog.min.js\"></script>\r\n"); out.write(" <script src=\"js/pattern.js\"></script>\r\n"); out.write(" <script src=\"js/script.js\"></script>\r\n"); out.write(" <script src=\"js/editCustomer.js\"></script>\r\n"); out.write(" </head>\r\n"); out.write(" <nav class=\"navbar\">\r\n"); out.write(" <div class=\"container-fluid\">\r\n"); out.write(" <!-- Brand and toggle get grouped for better mobile display -->\r\n"); out.write(" <div class=\"navbar-header\">\r\n"); out.write( " <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#bs-example-navbar-collapse-1\" aria-expanded=\"false\">\r\n"); out.write(" <span class=\"sr-only\">Toggle navigation</span>\r\n"); out.write(" <span class=\"icon-bar\"></span>\r\n"); out.write(" <span class=\"icon-bar\"></span>\r\n"); out.write(" <span class=\"icon-bar\"></span>\r\n"); out.write(" </button>\r\n"); out.write(" </div>\r\n"); out.write(" <!-- navbar-header -->\r\n"); out.write( " <!-- Collect the nav links, forms, and other content for toggling -->\r\n"); out.write(" <div class=\"myNavbar\">\r\n"); out.write(" <ul class=\"nav\">\r\n"); out.write( " <li class=\"floatLeft\"><a href=\"ManagerInformation.jsp\">Home</a></li>\r\n"); out.write( " <li class=\"dropdown navbar-right\" style=\"padding-left:125px;\">\r\n"); out.write( " <a data-target=\"#collapseHelp\" data-toggle=\"collapse\">Help<span class=\"caret\"></span></a>\r\n"); out.write(" <ul>\r\n"); out.write(" <div id=\"collapseHelp\" class=\"dropdown-menu\">\r\n"); out.write( " <li><a href=\"javascript:showEmployeeScreenHelp()\">Screens</a></li>\r\n"); out.write(" <br>\r\n"); out.write( " <li><a href=\"javascript:showAuctionHelp()\">Auctions</a></li>\r\n"); out.write(" <br>\r\n"); out.write(" </div>\r\n"); out.write(" </ul>\r\n"); out.write(" </li>\r\n"); out.write( " <li class=\"dropdown navbar-right\" style=\"padding-left:200px;\">\r\n"); out.write( " <a data-target=\"#collapseMenu\" data-toggle=\"collapse\" >Menu<span class=\"caret\"></span></a>\r\n"); out.write(" <ul>\r\n"); out.write(" <div id=\"collapseMenu\" class=\"dropdown-menu\">\r\n"); out.write(" </div>\r\n"); out.write(" </ul>\r\n"); out.write(" </li>\r\n"); out.write(" </ul>\r\n"); out.write(" <!-- .nav -->\r\n"); out.write(" </div>\r\n"); out.write(" <!-- .myNavbar -->\r\n"); out.write(" </div>\r\n"); out.write(" <!-- .container-fluid -->\r\n"); out.write(" </nav>\r\n"); out.write(" <body class=\"auctionHouseBody\">\r\n"); out.write( " <h4 class=\"auctionTableHeader\">Highest Grossing Employee</h4>\r\n"); out.write( " <table id =\"bestSellersTable\" class=\"table table-striped table-bordered dt-responsive nowrap auctionHouseTable\">\r\n"); out.write(" <thead>\r\n"); out.write(" <tr>\r\n"); out.write(" <th>Employee ID</th>\r\n"); out.write(" <th>Username</th>\r\n"); out.write(" <th>Revenue</th>\r\n"); out.write(" </tr>\r\n"); out.write(" </thead>\r\n"); out.write(" <tbody>\r\n"); out.write(" "); while (employeeRevRes.next()) { out.write("\r\n"); out.write(" <tr>\r\n"); out.write(" <td>\r\n"); out.write(" "); out.print(employeeRevRes.getString("EmployeeID")); out.write("\r\n"); out.write(" </td>\r\n"); out.write(" <td>\r\n"); out.write(" "); out.print(employeeRevRes.getString("Username")); out.write("\r\n"); out.write(" </td>\r\n"); out.write(" <td>\r\n"); out.write(" "); out.print(employeeRevRes.getDouble("Revenue")); out.write("\r\n"); out.write(" </td>\r\n"); out.write(" </tr>\r\n"); out.write(" "); } out.write("\r\n"); out.write(" </tbody>\r\n"); out.write(" </table>\r\n"); out.write(" </body>\r\n"); out.write(" </html>\r\n"); out.write("\r\n"); out.write(" "); } catch (Exception e) { e.printStackTrace(); } finally { try { conn.close(); } catch (Exception ee) { } ; } out.write('\r'); out.write('\n'); } catch (java.lang.Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)) { out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { if (response.isCommitted()) { out.flush(); } else { out.clearBuffer(); } } catch (java.io.IOException e) { } if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } }
public Writer getErrorReport( Writer to, final HttpServletRequest request, CharTransformer escape) throws IOException { final Writer logMsg = new StringWriter(); final Writer tee = new org.mmbase.util.ChainedWriter(to, logMsg); Writer msg = tee; LinkedList<Throwable> stack = getStack(); String ticket = new Date().toString(); Map<String, String> props; try { props = org.mmbase.util.ApplicationContextReader.getProperties("mmbase_errorpage"); } catch (javax.naming.NamingException ne) { props = Collections.emptyMap(); log.info(ne); } if (request != null) { { msg.append("Headers\n----------\n"); // request properties for (Object name : Collections.list(request.getHeaderNames())) { msg.append( escape.transform( name + ": " + escape.transform(request.getHeader((String) name)) + "\n")); } } { msg.append("\nAttributes\n----------\n"); Pattern p = requestIgnore; if (p == null && props.get("request_ignore") != null) { p = Pattern.compile(props.get("request_ignore")); } for (Object name : Collections.list(request.getAttributeNames())) { if (p == null || !p.matcher((String) name).matches()) { msg.append( escape.transform(name + ": " + request.getAttribute((String) name) + "\n")); } } } if (Boolean.TRUE.equals(showSession) || (showSession == null && !"false".equals(props.get("show_session")))) { HttpSession ses = request.getSession(false); if (ses != null) { msg.append("\nSession\n----------\n"); Pattern p = sessionIgnore; if (p == null && props.get("session_ignore") != null) { p = Pattern.compile(props.get("session_ignore")); } for (Object name : Collections.list(ses.getAttributeNames())) { if (p == null || !p.matcher((String) name).matches()) { msg.append(escape.transform(name + ": " + ses.getAttribute((String) name) + "\n")); } } } } } msg.append("\n"); msg.append("Misc. properties\n----------\n"); if (request != null) { msg.append("method: ").append(escape.transform(request.getMethod())).append("\n"); msg.append("querystring: ").append(escape.transform(request.getQueryString())).append("\n"); msg.append("requesturl: ") .append(escape.transform(request.getRequestURL().toString())) .append("\n"); } if (Boolean.TRUE.equals(showMMBaseVersion) || (showMMBaseVersion == null && !"false".equals(props.get("show_mmbase_version")))) { msg.append("mmbase version: ").append(org.mmbase.Version.get()).append("\n"); } msg.append("status: ").append("").append(String.valueOf(status)).append("\n\n"); if (request != null) { msg.append("Parameters\n----------\n"); // request parameters Enumeration en = request.getParameterNames(); while (en.hasMoreElements()) { String name = (String) en.nextElement(); msg.append(name) .append(": ") .append(escape.transform(request.getParameter(name))) .append("\n"); } } msg.append("\nException ") .append(ticket) .append("\n----------\n\n") .append( exception != null ? (escape.transform(exception.getClass().getName())) : "NO EXCEPTION") .append(": "); int wroteCauses = 0; while (!stack.isEmpty()) { Throwable t = stack.removeFirst(); // add stack stacktraces if (t != null) { if (stack.isEmpty()) { // write last message always msg = tee; } String message = t.getMessage(); if (msg != tee) { to.append("\n=== skipped(see log) : ") .append(escape.transform(t.getClass().getName())) .append(": ") .append(message) .append("\n"); } msg.append("\n\n").append(escape.transform(t.getClass().getName() + ": " + message)); StackTraceElement[] stackTrace = t.getStackTrace(); for (StackTraceElement e : stackTrace) { msg.append("\n at ").append(escape.transform(e.toString())); } if (!stack.isEmpty()) { msg.append("\n-------caused:\n"); } wroteCauses++; if (wroteCauses >= MAX_CAUSES) { msg = logMsg; } } } // write errors to log if (status == 500) { try { if (props.get("to") != null && props.get("to").length() > 0) { javax.naming.Context initCtx = new javax.naming.InitialContext(); javax.naming.Context envCtx = (javax.naming.Context) initCtx.lookup("java:comp/env"); Object mailSession = envCtx.lookup("mail/Session"); Class sessionClass = Class.forName("javax.mail.Session"); Class recipientTypeClass = Class.forName("javax.mail.Message$RecipientType"); Class messageClass = Class.forName("javax.mail.internet.MimeMessage"); Object mail = messageClass.getConstructor(sessionClass).newInstance(mailSession); messageClass .getMethod("addRecipients", recipientTypeClass, String.class) .invoke(mail, recipientTypeClass.getDeclaredField("TO").get(null), props.get("to")); messageClass.getMethod("setSubject", String.class).invoke(mail, ticket); mail.getClass().getMethod("setText", String.class).invoke(mail, logMsg.toString()); Class.forName("javax.mail.Transport") .getMethod("send", Class.forName("javax.mail.Message")) .invoke(null, mail); tee.append("\nmailed to (").append(String.valueOf(props)).append(")"); } } catch (Exception nnfe) { tee.append("\nnot mailed (").append(String.valueOf(nnfe)).append(")"); if (log.isDebugEnabled()) { log.debug(nnfe.getMessage(), nnfe); } } log.error("TICKET " + ticket + ":\n" + logMsg); } return to; }
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, "", 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'); Connection conn = null; Class.forName("com.mysql.jdbc.Driver"); conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/db_shas", "root", "password"); ResultSet rsdoLogin = null; PreparedStatement psdoLogin = null; String sUserID = request.getParameter("username"); String sPassword = request.getParameter("password"); String message = "User login successfully "; try { String sqlOption = "select * FROM Users where username='******' and Password='******'"; psdoLogin = conn.prepareStatement(sqlOption); // psdoLogin.setString(1,sUserID); // psdoLogin.setString(2,sPassword); rsdoLogin = psdoLogin.executeQuery(); if (rsdoLogin.next()) { String sUserName = rsdoLogin.getString("firstname") + " " + rsdoLogin.getString("lastname"); session.setAttribute("sUserID", sUserName); // session.setAttribute("sUserID",rsdoLogin.getString("firstname")); // session.setAttribute("iUserType",rsdoLogin.getString("iUserType")); // session.setAttribute("iUserLevel",rsdoLogin.getString("iUserLevel")); // session.setAttribute("sUserName",sUserName); response.sendRedirect("success.jsp?statusmsg=" + message); } else { message = "Invalid credentials"; response.sendRedirect("Invalid.jsp?error=" + message); } } catch (Exception e) { e.printStackTrace(); } /// close object and connection try { if (psdoLogin != null) { psdoLogin.close(); } if (rsdoLogin != null) { rsdoLogin.close(); } if (conn != null) { conn.close(); } } catch (Exception e) { e.printStackTrace(); } } 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=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\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("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); try { Connection dbconnection = null; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); dbconnection = DriverManager.getConnection("jdbc:odbc:ets", "db2", "vicky"); Statement st; String username = (String) session.getAttribute("uname"); st = dbconnection.createStatement(); ResultSet rs = st.executeQuery("select * from Tag where username='******'"); out.write("\r\n"); out.write("\r\n"); out.write("<html>\r\n"); out.write("<head>\r\n"); out.write( "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\r\n"); out.write("<title>Company | Leading India</title>\r\n"); out.write("<link rel=\"stylesheet\" href=\"css/style.css\">\r\n"); out.write("</head>\r\n"); out.write("<body\r\n"); out.write( "\tstyle=\"background-image: url('images/header2.png'); background-repeat: no-repeat;\">\r\n"); out.write("<div id=\"container\">\r\n"); out.write("<div id=\"heading\">\r\n"); out.write("<h1 style=\"margin-left: 30px;\">Company | Leading India</h1>\r\n"); out.write("\r\n"); out.write("<div id=\"menu\"\r\n"); out.write("\tstyle=\"float: right; margin-right: 50px; margin-top: -50px;\">\r\n"); out.write("<ul>\r\n"); out.write("\t<li><a href=\"home_op_out.jsp\">Home</a></li>\r\n"); out.write("\t<li><a href=\"search_op.jsp\">Search</a></li>\r\n"); out.write("\t<li><a href=\"org_details_op.jsp\">Org. Details</a></li>\r\n"); out.write("\t<li><a href=\"hierarchy_op.jsp\">Hierarchy</a></li>\r\n"); out.write("</ul>\r\n"); out.write("</div>\r\n"); out.write("</div>\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("<div id=\"emp-left-content\"><img src=\"images/male_user.png\" /> <img\r\n"); out.write("\tsrc=\"images/line1.png\"\r\n"); out.write( "\tstyle=\"margin-top: -80px; margin-left: -20px; height: 175px; width: 200px;\" />\r\n"); out.write("<br />\r\n"); out.write("<br />\r\n"); out.write("<div id=\"lmenu\" style=\"margin-top: -80px; margin-left: 20px;\">\r\n"); out.write("<ul>\r\n"); out.write("\r\n"); out.write("\t<li><a href=\"update_details_op.jsp\"> Update Details</a></li>\r\n"); out.write("\t<li><a href=\"rfid_out_op.jsp\"> Go out</a></li>\r\n"); out.write("\t<li><a href=\"account_details_op.jsp\"> Account Details</a></li>\r\n"); out.write( "\t<li><a href=\"#\" onclick=\"alert('You should go out of reader in order to log out');\"> Log out</a></li>\r\n"); out.write("</ul>\r\n"); out.write("</div>\r\n"); out.write("</div>\r\n"); out.write("<img src=\"images/line.png\"\r\n"); out.write( "\tstyle=\"float: left; margin-left: 70px; margin-top: -420px; height: 550px; width: 200px;\" />\r\n"); out.write("<div id=\"emp-right-content\">\r\n"); out.write("<form action=\"http://localhost:8080/TGMC/home_op_out.jsp\" method=\"get\"\r\n"); out.write("\tonSubmit=\"validate()\" style=\"font-size:20px;\">\r\n"); while (rs.next()) { out.write("\r\n"); out.write("<table>\r\n"); out.write("\r\n"); out.write("\t<tr>\r\n"); out.write("\t\t<td>Tag Name</td>\r\n"); out.write("\t\t<td>"); out.print(rs.getString(1)); out.write("</td>\r\n"); out.write("\t</tr>\r\n"); out.write("\t<tr>\r\n"); out.write("\t\t<td>Join Date</td>\r\n"); out.write("\t\t<td>"); out.print(rs.getString(2)); out.write(" <br />\r\n"); out.write("\t\t</td>\r\n"); out.write("\t</tr>\r\n"); out.write("\t<tr>\r\n"); out.write("\t\t<td>Join Time</td>\r\n"); out.write("\t\t<td>"); out.print(rs.getString(3)); out.write(" <br />\r\n"); out.write("\t\t</td>\r\n"); out.write("\t</tr>\r\n"); out.write("\t<tr>\r\n"); out.write("\t\t<td>Last Log</td>\r\n"); out.write("\t\t<td>"); out.print(rs.getString(4)); out.write("</td>\r\n"); out.write("\t\t<td>"); out.print(rs.getString(5)); out.write(" </td>\r\n"); out.write("\t</tr>\r\n"); out.write("\r\n"); out.write("\t<tr>\r\n"); out.write("\t\t<td>Employee ID</td>\r\n"); out.write("\t\t<td>"); out.print(rs.getString("empid")); out.write("</td>\r\n"); out.write("\t\t\r\n"); out.write("\t</tr>\r\n"); out.write("\r\n"); out.write("You have worked for "); out.print(rs.getString("nohr")); out.write(" hours and "); out.print(rs.getString("nomin")); out.write(" minutes\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\t\r\n"); out.write("\t\r\n"); out.write( "\t<tr><td colspan=\"4\"><center><input type=\"submit\" value=\"OK\" style=\"background-color: #5C92E9; color: #fff;\" /></center></td></tr>\r\n"); out.write("\r\n"); out.write("</table>\r\n"); } } catch (Exception e) { out.print(e); } out.write("\r\n"); out.write("</form>\r\n"); out.write("</div>\r\n"); out.write("</div>\r\n"); out.write("\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) try { out.clearBuffer(); } catch (java.io.IOException e) { } if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } }