Spring + Hibernate Could not toggle autocommit

org.hibernate.transaction.JDBCTransaction
Could not toggle autocommit
java.sql.SQLException: Closed Connection
org.hibernate.transaction.JDBCTransaction
JDBC commit failed
java.sql.SQLException: Io exception: Connection reset
org.springframework.transaction.TransactionSystemException: Could not commit Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC commit failed
求大神指导,Spring + Hibernate,隔一段时间会自动挂死,以上是相关异常

数据库是ORACLE的,以下是连接池配置信息
hibernate.c3p0.min_size=1
hibernate.c3p0.max_size=20
hibernate.c3p0.timeout=21600
hibernate.c3p0.max_statements=0
hibernate.c3p0.idle_test_period=1800
hibernate.c3p0.acquire_increment=2
hibernate.c3p0.checkoutTimeout=30000

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Spring + Hibernate Could not toggle autocommit
org.hibernate.transaction.JDBCTransaction Could not toggle autocommit java.sql.SQLException: Closed Connection org.hibernate.transaction.JDBCTransaction JDBC commit failed java.sql.SQLException: Io exception: Connection reset org.springframework.transaction.TransactionSystemException: Could not commit Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC commit failed 求大神指导,Spring + Hibernate,隔一段时间会自动挂死,以上是相关异常 数据库是ORACLE的,以下是连接池配置信息 hibernate.c3p0.min_size=1 hibernate.c3p0.max_size=20 hibernate.c3p0.timeout=21600 hibernate.c3p0.max_statements=0 hibernate.c3p0.idle_test_period=1800 hibernate.c3p0.acquire_increment=2 hibernate.c3p0.checkoutTimeout=30000
struts2+hibernate+spring+proxool性能问题
项目已经跑了2个多月了,今天突然出现不能访问的问题。 第一开始是访问一直刷不出页面,但是tomcat控制台却一下一下的在执行,(很慢的执行,很久才输出一条hibernate的语句) 之后将所有的应用重启了一次, 依然访问不了网站。 一直让他持续连接就会给我报错。 [code="java"] 2009-09-24 11:47:12 [org.logicalcobwebs.proxool.BESTVDB]-[WARN] #0008 was active for 1939871 milliseconds and has been removed automaticaly. The Thread responsible was named 'http-8080-Processor45', and the last SQL it performed is 'select iptvaction0_.action_id as action1_, iptvaction0_.uid as uid11_, iptvaction0_.username as username11_, iptvaction0_.con as con11_, iptvaction0_.cat as cat11_, iptvaction0_.friend_id as friend6_11_, iptvaction0_.friendname as friendname11_, iptvaction0_.code as code11_, iptvaction0_.state_id as state9_11_, iptvaction0_.remark as remark11_, iptvaction0_.datetime as datetime11_, iptvaction0_.allowed as allowed11_, iptvaction0_.visable as visable11_, iptvaction0_.action_place as action14_11_ from iptv_action iptvaction0_ where iptvaction0_.uid in (select iptvmyfrie1_.friendid from iptv_myfriends iptvmyfrie1_ where iptvmyfrie1_.uid=723) order by iptvaction0_.datetime desc limit 3; '. 2009-09-24 11:47:12 [org.hibernate.transaction.JDBCTransaction]-[ERROR] Could not toggle autocommit com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:985) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1113) at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:4790) at sun.reflect.GeneratedMethodAccessor126.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.logicalcobwebs.proxool.WrappedConnection.invoke(WrappedConnection.java:162) at org.logicalcobwebs.proxool.WrappedConnection.intercept(WrappedConnection.java:87) at com.mysql.jdbc.Connection$$EnhancerByProxool$$6a89ac94.setAutoCommit(<generated>) at org.hibernate.transaction.JDBCTransaction.toggleAutoCommit(JDBCTransaction.java:174) at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:122) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:95) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:578) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:662) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632) [/code] [code="java"] javax.servlet.ServletException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionException: JDBC begin failed: org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99) org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) root cause org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionException: JDBC begin failed: org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:541) org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350) root cause org.hibernate.TransactionException: JDBC begin failed: org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:58) org.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:24) org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:271) org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1079) org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:510) root cause java.sql.SQLException: Couldn't perform the operation getAutoCommit: You can't perform any operations on this connection. It has been automatically closed by Proxool for some reason (see logs). org.logicalcobwebs.proxool.WrappedConnection.invoke(WrappedConnection.java:207) org.logicalcobwebs.proxool.WrappedConnection.intercept(WrappedConnection.java:87) com.mysql.jdbc.ConnectionProperties$$EnhancerByProxool$$9313bf3c.getAutoCommit(<generated>) org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:49) org.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:24) org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:271) [/code] 异常信息大概如上所示。 找不到头绪。 不知道该如何下手去优化?还是? 我该如何做? 这是我的第一个项目。还希望各位前辈给出指点!谢谢!
请教一下,我这个导航栏怎么增加每个导航按钮之间的间距呢?
<!DOCTYPE html> <html> <head> <link rel="icon" href="images/favicon.ico" type="img/x-ico" /> <title>山东金泽网络科技有限公司</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="utf-8"> <meta name="keywords" content="" /> <script type="application/x-javascript"> addEventListener("load", function () { setTimeout(hideURLbar, 0); }, false); function hideURLbar() { window.scrollTo(0, 1); } </script> <link href="css/bootstrap.css" rel='stylesheet' type='text/css' /> <link rel="stylesheet" href="css/flexslider.css" type="text/css" media="screen" property="" /> <link href="css/style.css" rel='stylesheet' type='text/css' /> <link href="css/simpleLightbox.css" rel='stylesheet' type='text/css' /> <link href="css/fontawesome-all.css" rel="stylesheet"> <link href="http://fonts.googleapis.com/css?family=Poppins:100i,200,200i,300,400,400i,500,500i,600,600i,700,700i,800" rel="stylesheet"> </head> <body> <header> <div class="header_top" id="home"> <nav class="navbar navbar-toggleable-md navbar-light bg-faded"> <a class="navbar-brand" href="index.html"> <i class="fab fa-digital-ocean"></i> 金泽科技</a> <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav mx-auto tp-nav text-center"> <li class="nav-item active"> <a class="nav-link" href="index.html">首页 <span class="sr-only">(current)</span> </a> </li> <li class="nav-item"> <a class="nav-link" href="about.html">关于</a> </li> <li class="nav-item"> <a class="nav-link" href="了解银豹.html">解决方案</a> </li> <li class="nav-item"> <a class="nav-link" href="blog.html">博客</a> </li> <li class="nav-item"> <a class="nav-link" href="contact.html">联系我们</a> </li> </ul> <form action="#" method="post" class="form-inline my-2 my-lg-0 search"> <input class="form-control mr-sm-2" type="search" placeholder="点击输入搜索..." name="Search" required> <button class="btn btn-outline-success my-2 my-sm-0" type="submit">搜索</button> </form> </div> </nav> </div> </header> <!--//header--> </body> </html> ``` ```
bootstrap导航条,在google chrome出现的问题
**我做出来的导航条是竖着的,本来以为是自己代码写错了。然后换官方的试,但还是出现了相应的问题** 如下图 ![图片说明](https://img-ask.csdn.net/upload/201911/26/1574736191_907887.png) ``` <!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org"> <head> <title>维族之家</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="styleesheet" href="css/bootstrap.min.css"/> <link rel="styleesheet" href="css/bootstrap-theme.min.css"/> <script src="js/bootstrap.min.js" type="application/javascript"></script> </head> <body> <nav class="navbar navbar-default"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Brand</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li> <li><a href="#">Link</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> <li role="separator" class="divider"></li> <li><a href="#">One more separated link</a></li> </ul> </li> </ul> <form class="navbar-form navbar-left"> <div class="form-group"> <input type="text" class="form-control" placeholder="Search"> </div> <button type="submit" class="btn btn-default">Submit</button> </form> <ul class="nav navbar-nav navbar-right"> <li><a href="#">Link</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav> </body> </html> ```
js怎么设置按钮点击后改变颜色
我已经设置好三个按钮,怎么设置js可以实现点击按钮后。此按钮颜色改变,其他2个按钮颜色不变。 ``` <!DOCTYPE html> <html> <head> <title></title> </head> <script src="js/jquery-1.10.2.min.js" type="text/javascript" charset="utf-8"></script> <script> $(function(){ $("#btn1").click(function() { $("#content1").toggle(); var str = btn.innerHTML =="按钮1"? "显示":"按钮1"; btn.innerHTML =str; }); $("#btn2").click(function() { $("#content2").toggle(); var str = btn.innerHTML =="隐藏"? "显示":"隐藏"; btn.innerHTML =str; }); $("#bt3").click(function() { $("#content3").toggle(); var str = btn.innerHTML =="隐藏"? "显示":"隐藏"; btn.innerHTML =str; }); }); </script> <body> <button id="btn1" >第一页1</button> <button id="btn2" >第二页2</button> <button id="btn3" >第三页</button> <p id="content1">1也许明天,也许梦里,我重新拾起我最爱的诗,感动了所有的风和日丽</p> <p id="content2">2也许明天,也许梦里,我重新拾起我最爱的诗,感动了所有的风和日丽</p> <p id="content3">3也许明天,也许梦里,我重新拾起我最爱的诗,感动了所有的风和日丽</p> </body> </html> ```
HTTP Status 500 – Internal Server Error(jspmaker生成,tomcat实现)
内容是用Jspmaker把数据库表生成jsp,然后用tomcat,结果出现了以下问题 网站报错代码如下: HTTP Status 500 – Internal Server ErrorType 异常报告 消息 在 [146] 行处理 [/jspmoon/customerlist.jsp] 时发生异常 描述 服务器遇到一个意外的情况,阻止它完成请求。 Exception org.apache.jasper.JasperException: 在 [146] 行处理 [/jspmoon/customerlist.jsp] 时发生异常 143: // Open Connection to the database 144: try{ 145: Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); 146: ResultSet rs = null; 147: // Build SQL 148: String strsql = "SELECT * FROM `customer`"; 149: whereClause = ""; Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:617) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:514) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) Root Cause java.lang.NullPointerException org.apache.jsp.jspmoon.customerlist_jsp._jspService(customerlist_jsp.java:585) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ):注意 主要问题的全部 stack 信息可以在 server logs 里查看 Apache Tomcat/8.5.50 jsp代码: <%@ page session="true" buffer="16kb" import="java.sql.*,java.util.*,java.text.*"%> <%@ page contentType="text/html; charset=UTF-8" %> <% response.setDateHeader("Expires", 0); // date in the past response.addHeader("Cache-Control", "no-store, no-cache, must-revalidate"); // HTTP/1.1 response.addHeader("Cache-Control", "post-check=0, pre-check=0"); response.addHeader("Pragma", "no-cache"); // HTTP/1.0 %> <% Locale locale = Locale.getDefault(); response.setLocale(locale);%> <% session.setMaxInactiveInterval(30*60); %> <%@ include file="db.jsp" %> <%@ include file="jspmkrfn.jsp" %> <% int displayRecs = 20; int recRange = 10; %> <% String tmpfld = null; String escapeString = "\\\\'"; String dbwhere = ""; String masterdetailwhere = ""; String searchwhere = ""; String a_search = ""; String b_search = ""; String whereClause = ""; int startRec = 0, stopRec = 0, totalRecs = 0, recCount = 0; %> <% // Get search criteria for basic search String pSearch = request.getParameter("psearch"); String pSearchType = request.getParameter("psearchtype"); if (pSearch != null && pSearch.length() > 0) { pSearch = pSearch.replaceAll("'",escapeString); if (pSearchType != null && pSearchType.length() > 0) { while (pSearch.indexOf(" ") > 0) { pSearch = pSearch.replaceAll(" ", " "); } String [] arpSearch = pSearch.trim().split(" "); for (int i = 0; i < arpSearch.length; i++){ String kw = arpSearch[i].trim(); b_search = b_search + "("; b_search = b_search + "`C_NAME` LIKE '%" + kw + "%' OR "; b_search = b_search + "`C_ADDRESS` LIKE '%" + kw + "%' OR "; b_search = b_search + "`C_PHONE` LIKE '%" + kw + "%' OR "; b_search = b_search + "`C_MATSEGMENT` LIKE '%" + kw + "%' OR "; b_search = b_search + "`C_COMMENT` LIKE '%" + kw + "%' OR "; if (b_search.substring(b_search.length()-4,b_search.length()).equals(" OR ")) { b_search = b_search.substring(0,b_search.length()-4);} b_search = b_search + ") " + pSearchType + " "; } }else{ b_search = b_search + "`C_NAME` LIKE '%" + pSearch + "%' OR "; b_search = b_search + "`C_ADDRESS` LIKE '%" + pSearch + "%' OR "; b_search = b_search + "`C_PHONE` LIKE '%" + pSearch + "%' OR "; b_search = b_search + "`C_MATSEGMENT` LIKE '%" + pSearch + "%' OR "; b_search = b_search + "`C_COMMENT` LIKE '%" + pSearch + "%' OR "; } } if (b_search.length() > 4 && b_search.substring(b_search.length()-4,b_search.length()).equals(" OR ")) {b_search = b_search.substring(0, b_search.length()-4);} if (b_search.length() > 5 && b_search.substring(b_search.length()-5,b_search.length()).equals(" AND ")) {b_search = b_search.substring(0, b_search.length()-5);} %> <% // Build search criteria if (a_search != null && a_search.length() > 0) { searchwhere = a_search; // Advanced search }else if (b_search != null && b_search.length() > 0) { searchwhere = b_search; // Basic search } // Save search criteria if (searchwhere != null && searchwhere.length() > 0) { session.setAttribute("customer_searchwhere", searchwhere); startRec = 1; // Reset start record counter (new search) session.setAttribute("customer_REC", new Integer(startRec)); }else{ if (session.getAttribute("customer_searchwhere") != null) searchwhere = (String) session.getAttribute("customer_searchwhere"); } %> <% // Get clear search cmd startRec = 0; if (request.getParameter("cmd") != null && request.getParameter("cmd").length() > 0) { String cmd = request.getParameter("cmd"); if (cmd.toUpperCase().equals("RESET")) { searchwhere = ""; // Reset search criteria session.setAttribute("customer_searchwhere", searchwhere); }else if (cmd.toUpperCase().equals("RESETALL")) { searchwhere = ""; // Reset search criteria session.setAttribute("customer_searchwhere", searchwhere); } startRec = 1; // Reset start record counter (reset command) session.setAttribute("customer_REC", new Integer(startRec)); } // Build dbwhere if (masterdetailwhere != null && masterdetailwhere.length() > 0) { dbwhere = dbwhere + "(" + masterdetailwhere + ") AND "; } if (searchwhere != null && searchwhere.length() > 0) { dbwhere = dbwhere + "(" + searchwhere + ") AND "; } if (dbwhere != null && dbwhere.length() > 5) { dbwhere = dbwhere.substring(0, dbwhere.length()-5); // Trim rightmost AND } %> <% // Load Default Order String DefaultOrder = ""; String DefaultOrderType = ""; // No Default Filter String DefaultFilter = ""; // Check for an Order parameter String OrderBy = request.getParameter("order"); if (OrderBy != null && OrderBy.length() > 0) { if (session.getAttribute("customer_OB") != null && ((String) session.getAttribute("customer_OB")).equals(OrderBy)) { // Check if an ASC/DESC toggle is required if (((String) session.getAttribute("customer_OT")).equals("ASC")) { session.setAttribute("customer_OT", "DESC"); }else{ session.setAttribute("customer_OT", "ASC"); } }else{ session.setAttribute("customer_OT", "ASC"); } session.setAttribute("customer_OB", OrderBy); session.setAttribute("customer_REC", new Integer(1)); }else{ OrderBy = (String) session.getAttribute("customer_OB"); if (OrderBy == null || OrderBy.length() == 0) { OrderBy = DefaultOrder; session.setAttribute("customer_OB", OrderBy); session.setAttribute("customer_OT", DefaultOrderType); } } // Open Connection to the database try{ Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs = null; // Build SQL String strsql = "SELECT * FROM `customer`"; whereClause = ""; if (DefaultFilter.length() > 0) { whereClause = whereClause + "(" + DefaultFilter + ") AND "; } if (dbwhere.length() > 0) { whereClause = whereClause + "(" + dbwhere + ") AND "; } if (whereClause.length() > 5 && whereClause.substring(whereClause.length()-5, whereClause.length()).equals(" AND ")) { whereClause = whereClause.substring(0, whereClause.length()-5); } if (whereClause.length() > 0) { strsql = strsql + " WHERE " + whereClause; } if (OrderBy != null && OrderBy.length() > 0) { strsql = strsql + " ORDER BY `" + OrderBy + "` " + (String) session.getAttribute("customer_OT"); } //out.println(strsql); rs = stmt.executeQuery(strsql); rs.last(); totalRecs = rs.getRow(); rs.beforeFirst(); startRec = 0; int pageno = 0; // Check for a START parameter if (request.getParameter("start") != null && Integer.parseInt(request.getParameter("start")) > 0) { startRec = Integer.parseInt(request.getParameter("start")); session.setAttribute("customer_REC", new Integer(startRec)); }else if (request.getParameter("pageno") != null && Integer.parseInt(request.getParameter("pageno")) > 0) { pageno = Integer.parseInt(request.getParameter("pageno")); if (IsNumeric(request.getParameter("pageno"))) { startRec = (pageno-1)*displayRecs+1; if (startRec <= 0) { startRec = 1; }else if (startRec >= ((totalRecs-1)/displayRecs)*displayRecs+1) { startRec = ((totalRecs-1)/displayRecs)*displayRecs+1; } session.setAttribute("customer_REC", new Integer(startRec)); }else { startRec = ((Integer) session.getAttribute("customer_REC")).intValue(); if (startRec <= 0) { startRec = 1; // Reset start record counter session.setAttribute("customer_REC", new Integer(startRec)); } } }else{ if (session.getAttribute("customer_REC") != null) startRec = ((Integer) session.getAttribute("customer_REC")).intValue(); if (startRec==0) { startRec = 1; //Reset start record counter session.setAttribute("customer_REC", new Integer(startRec)); } } %> <%@ include file="header.jsp" %> <p><span class="jspmaker">TABLE: customer</span></p> <form action="customerlist.jsp"> <table border="0" cellspacing="0" cellpadding="4"> <tr> <td><span class="jspmaker">Quick Search (*)</span></td> <td><span class="jspmaker"> <input type="text" name="psearch" size="20"> <input type="Submit" name="Submit" value="GO"> &nbsp;&nbsp;<a href="customerlist.jsp?cmd=reset">Show all</a> </span></td> </tr> <tr><td>&nbsp;</td><td><span class="jspmaker"><input type="radio" name="psearchtype" value="" checked>Exact phrase&nbsp;&nbsp;<input type="radio" name="psearchtype" value="AND">All words&nbsp;&nbsp;<input type="radio" name="psearchtype" value="OR">Any word</span></td></tr> </table> </form> <form method="post"> <table border="0" cellspacing="1" cellpadding="4" bgcolor="#CCCCCC"> <tr bgcolor="#594FBF"> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_CUSTKEY","UTF-8") %>" style="color: #FFFFFF;">C CUSTKEY&nbsp;<% if (OrderBy != null && OrderBy.equals("C_CUSTKEY")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_NAME","UTF-8") %>" style="color: #FFFFFF;">C NAME&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_NAME")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_ADDRESS","UTF-8") %>" style="color: #FFFFFF;">C ADDRESS&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_ADDRESS")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_NATIONKEY","UTF-8") %>" style="color: #FFFFFF;">C NATIONKEY&nbsp;<% if (OrderBy != null && OrderBy.equals("C_NATIONKEY")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_PHONE","UTF-8") %>" style="color: #FFFFFF;">C PHONE&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_PHONE")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_ACCTBAL","UTF-8") %>" style="color: #FFFFFF;">C ACCTBAL&nbsp;<% if (OrderBy != null && OrderBy.equals("C_ACCTBAL")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_MATSEGMENT","UTF-8") %>" style="color: #FFFFFF;">C MATSEGMENT&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_MATSEGMENT")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_COMMENT","UTF-8") %>" style="color: #FFFFFF;">C COMMENT&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_COMMENT")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <% // Avoid starting record > total records if (startRec > totalRecs) { startRec = totalRecs; } // Set the last record to display stopRec = startRec + displayRecs - 1; // Move to first record directly for performance reason recCount = startRec - 1; if (rs.next()) { rs.first(); rs.relative(startRec - 1); } long recActual = 0; if (startRec == 1) rs.beforeFirst(); else rs.previous(); while (rs.next() && recCount < stopRec) { recCount++; if (recCount >= startRec) { recActual++; %> <% String bgcolor = "#FFFFFF"; // Set row color %> <% if (recCount%2 != 0) { // Display alternate color for rows bgcolor = "#F5F5F5"; } %> <% String x_C_CUSTKEY = ""; String x_C_NAME = ""; String x_C_ADDRESS = ""; String x_C_NATIONKEY = ""; String x_C_PHONE = ""; String x_C_ACCTBAL = ""; String x_C_MATSEGMENT = ""; String x_C_COMMENT = ""; // Load Key for record String key = ""; key = String.valueOf(rs.getLong("C_CUSTKEY")); // C_CUSTKEY x_C_CUSTKEY = String.valueOf(rs.getLong("C_CUSTKEY")); // C_NAME if (rs.getString("C_NAME") != null){ x_C_NAME = rs.getString("C_NAME"); }else{ x_C_NAME = ""; } // C_ADDRESS if (rs.getString("C_ADDRESS") != null){ x_C_ADDRESS = rs.getString("C_ADDRESS"); }else{ x_C_ADDRESS = ""; } // C_NATIONKEY x_C_NATIONKEY = String.valueOf(rs.getLong("C_NATIONKEY")); // C_PHONE if (rs.getString("C_PHONE") != null){ x_C_PHONE = rs.getString("C_PHONE"); }else{ x_C_PHONE = ""; } // C_ACCTBAL x_C_ACCTBAL = String.valueOf(rs.getDouble("C_ACCTBAL")); // C_MATSEGMENT if (rs.getString("C_MATSEGMENT") != null){ x_C_MATSEGMENT = rs.getString("C_MATSEGMENT"); }else{ x_C_MATSEGMENT = ""; } // C_COMMENT if (rs.getString("C_COMMENT") != null){ x_C_COMMENT = rs.getString("C_COMMENT"); }else{ x_C_COMMENT = ""; } %> <tr bgcolor="<%= bgcolor %>"> <td><span class="jspmaker"><% out.print(x_C_CUSTKEY); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_NAME); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_ADDRESS); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_NATIONKEY); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_PHONE); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_ACCTBAL); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_MATSEGMENT); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_COMMENT); %></span>&nbsp;</td> <td><span class="jspmaker"><a href="<% key = rs.getString("C_CUSTKEY"); if (key != null && key.length() > 0) { out.print("customerview.jsp?key=" + java.net.URLEncoder.encode(key,"UTF-8")); }else{ out.print("javascript:alert('Invalid Record! Key is null');"); } %>">View</a></span></td> <td><span class="jspmaker"><a href="<% key = rs.getString("C_CUSTKEY"); if (key != null && key.length() > 0) { out.print("customeredit.jsp?key=" + java.net.URLEncoder.encode(key,"UTF-8")); }else{ out.print("javascript:alert('Invalid Record! Key is null');"); } %>">Edit</a></span></td> <td><span class="jspmaker"><a href="<% key = rs.getString("C_CUSTKEY"); if (key != null && key.length() > 0) { out.print("customeradd.jsp?key=" + java.net.URLEncoder.encode(key,"UTF-8")); }else{ out.print("javascript:alert('Invalid Record! Key is null');"); } %>">Copy</a></span></td> <td><span class="jspmaker"><a href="<% key = rs.getString("C_CUSTKEY"); if (key != null && key.length() > 0) { out.print("customerdelete.jsp?key=" + java.net.URLEncoder.encode(key,"UTF-8")); }else{ out.print("javascript:alert('Invalid Record! Key is null');"); } %>">Delete</a></span></td> </tr> <% // } } } %> </table> </form> <% // Close recordset and connection rs.close(); rs = null; stmt.close(); stmt = null; conn.close(); conn = null; }catch(SQLException ex){ out.println(ex.toString()); } %> <table border="0" cellspacing="0" cellpadding="10"><tr><td> <% boolean rsEof = false; if (totalRecs > 0) { rsEof = (totalRecs < (startRec + displayRecs)); int PrevStart = startRec - displayRecs; if (PrevStart < 1) { PrevStart = 1;} int NextStart = startRec + displayRecs; if (NextStart > totalRecs) { NextStart = startRec;} int LastStart = ((totalRecs-1)/displayRecs)*displayRecs+1; %> <form> <table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="jspmaker">Page</span>&nbsp;</td> <!--first page button--> <% if (startRec==1) { %> <td><img src="images/firstdisab.gif" alt="First" width="20" height="15" border="0"></td> <% }else{ %> <td><a href="customerlist.jsp?start=1"><img src="images/first.gif" alt="First" width="20" height="15" border="0"></a></td> <% } %> <!--previous page button--> <% if (PrevStart == startRec) { %> <td><img src="images/prevdisab.gif" alt="Previous" width="20" height="15" border="0"></td> <% }else{ %> <td><a href="customerlist.jsp?start=<%=PrevStart%>"><img src="images/prev.gif" alt="Previous" width="20" height="15" border="0"></a></td> <% } %> <!--current page number--> <td><input type="text" name="pageno" value="<%=(startRec-1)/displayRecs+1%>" size="4"></td> <!--next page button--> <% if (NextStart == startRec) { %> <td><img src="images/nextdisab.gif" alt="Next" width="20" height="15" border="0"></td> <% }else{ %> <td><a href="customerlist.jsp?start=<%=NextStart%>"><img src="images/next.gif" alt="Next" width="20" height="15" border="0"></a></td> <% } %> <!--last page button--> <% if (LastStart == startRec) { %> <td><img src="images/lastdisab.gif" alt="Last" width="20" height="15" border="0"></td> <% }else{ %> <td><a href="customerlist.jsp?start=<%=LastStart%>"><img src="images/last.gif" alt="Last" width="20" height="15" border="0"></a></td> <% } %> <td><a href="customeradd.jsp"><img src="images/addnew.gif" alt="Add new" width="20" height="15" border="0"></a></td> <td><span class="jspmaker">&nbsp;of <%=(totalRecs-1)/displayRecs+1%></span></td> </td></tr></table> </form> <% if (startRec > totalRecs) { startRec = totalRecs;} stopRec = startRec + displayRecs - 1; recCount = totalRecs - 1; if (rsEof) { recCount = totalRecs;} if (stopRec > recCount) { stopRec = recCount;} %> <span class="jspmaker">Records <%= startRec %> to <%= stopRec %> of <%= totalRecs %></span> <% }else{ %> <span class="jspmaker">No records found</span> <p> <a href="customeradd.jsp"><img src="images/addnew.gif" alt="Add new" width="20" height="15" border="0"></a> </p> <% } %> </td></tr></table> <%@ include file="footer.jsp" %>
怎么把网页1的导航完美移植到网页2的轮播图上边的位置使导航和轮播图结合成一个网页
网页1带导航的 <!DOCTYPE html> <html> <head> <link rel="icon" href="images/favicon.ico" type="img/x-ico" /> <title>山东金泽网络科技有限公司</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="utf-8"> <meta name="keywords" content="" /> <script type="application/x-javascript"> addEventListener("load", function () { setTimeout(hideURLbar, 0); }, false); function hideURLbar() { window.scrollTo(0, 1); } </script> <link href="css/bootstrap.css" rel='stylesheet' type='text/css' /> <link rel="stylesheet" href="css/flexslider.css" type="text/css" media="screen" property="" /> <link href="css/style.css" rel='stylesheet' type='text/css' /> <link href="css/simpleLightbox.css" rel='stylesheet' type='text/css' /> <link href="css/fontawesome-all.css" rel="stylesheet"> <link href="http://fonts.googleapis.com/css?family=Poppins:100i,200,200i,300,400,400i,500,500i,600,600i,700,700i,800" rel="stylesheet"> </head> <body> <header> <div class="header_top" id="home"> <nav class="navbar navbar-toggleable-md navbar-light bg-faded"> <a class="navbar-brand" href="index.html"> <i class="fab fa-digital-ocean"></i> 金泽科技</a> <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav mx-auto tp-nav text-center"> <li class="nav-item active"> <a class="nav-link" href="index.html">首页 <span class="sr-only">(current)</span> </a> </li> <li class="nav-item"> <a class="nav-link" href="about.html">关于</a> </li> <li class="nav-item"> <a class="nav-link" href="了解银豹.html">解决方案</a> </li> <li class="nav-item"> <a class="nav-link" href="blog.html">博客</a> </li> <li class="nav-item"> <a class="nav-link" href="contact.html">联系我们</a> </li> </ul> <form action="#" method="post" class="form-inline my-2 my-lg-0 search"> <input class="form-control mr-sm-2" type="search" placeholder="点击输入搜索..." name="Search" required> <button class="btn btn-outline-success my-2 my-sm-0" type="submit">搜索</button> </form> </div> </nav> </div> </header> <!--//header--> </body> </html> ``` 网页2 轮播图代码: ``` <!DOCTYPE html> <html> <head> <link rel="icon" href="images/favicon.ico" type="img/x-ico" /> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>山东金泽网络科技有限公司</title> <link rel="stylesheet" href="css/style.css" /> </head> <body> <div class="c-banner"> <div class="banner"> <ul> <li><img src="img/lunbo1.jpg"></li> <li><img src="img/lunbo2.jpg"></li> <li><img src="img/lunbo3.jpg"></li> </ul> </div> <div class="nexImg"> <img src="img/nexImg.png" /> </div> <div class="preImg"> <img src="img/preImg.png" /> </div> <div class="jumpBtn"> <ul> <li jumpImg="0"></li> <li jumpImg="1"></li> <li jumpImg="2"></li> </ul> </div> </div> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript"> //定时器返回值 var time=null; //记录当前位子 var nexImg = 0; //用于获取轮播图图片个数 var imgLength = $(".c-banner .banner ul li").length; //当时动态数据的时候使用,上面那个删除 // var imgLength =0; //设置底部第一个按钮样式 $(".c-banner .jumpBtn ul li[jumpImg="+nexImg+"]").css("background-color","black"); //页面加载 $(document).ready(function(){ // dynamicData(); //启动定时器,设置时间为3秒一次 time =setInterval(intervalImg,3000); }); //点击上一张 $(".preImg").click(function(){ //清楚定时器 clearInterval(time); var nowImg = nexImg; nexImg = nexImg-1; console.log(nexImg); if(nexImg<0){ nexImg=imgLength-1; } //底部按钮样式设置 $(".c-banner .jumpBtn ul li").css("background-color","white"); $(".c-banner .jumpBtn ul li[jumpImg="+nexImg+"]").css("background-color","black"); //将当前图片试用绝对定位,下一张图片试用相对定位 $(".c-banner .banner ul img").eq(nowImg).css("position","absolute"); $(".c-banner .banner ul img").eq(nexImg).css("position","relative"); //轮播淡入淡出 $(".c-banner .banner ul li").eq(nexImg).css("display","block"); $(".c-banner .banner ul li").eq(nexImg).stop().animate({"opacity":1},1000); $(".c-banner .banner ul li").eq(nowImg).stop().animate({"opacity":0},1000,function(){ $(".c-banner ul li").eq(nowImg).css("display","none"); }); //启动定时器,设置时间为3秒一次 time =setInterval(intervalImg,3000); }) //点击下一张 $(".nexImg").click(function(){ clearInterval(time); intervalImg(); time =setInterval(intervalImg,3000); }) //轮播图 function intervalImg(){ if(nexImg<imgLength-1){ nexImg++; }else{ nexImg=0; } //将当前图片试用绝对定位,下一张图片试用相对定位 $(".c-banner .banner ul img").eq(nexImg-1).css("position","absolute"); $(".c-banner .banner ul img").eq(nexImg).css("position","relative"); $(".c-banner .banner ul li").eq(nexImg).css("display","block"); $(".c-banner .banner ul li").eq(nexImg).stop().animate({"opacity":1},1000); $(".c-banner .banner ul li").eq(nexImg-1).stop().animate({"opacity":0},1000,function(){ $(".c-banner .banner ul li").eq(nexImg-1).css("display","none"); }); $(".c-banner .jumpBtn ul li").css("background-color","white"); $(".c-banner .jumpBtn ul li[jumpImg="+nexImg+"]").css("background-color","black"); } //轮播图底下按钮 //动态数据加载的试用应放在请求成功后执行该代码,否则按钮无法使用 $(".c-banner .jumpBtn ul li").each(function(){ //为每个按钮定义点击事件 $(this).click(function(){ clearInterval(time); $(".c-banner .jumpBtn ul li").css("background-color","white"); jumpImg = $(this).attr("jumpImg"); if(jumpImg!=nexImg){ var after =$(".c-banner .banner ul li").eq(jumpImg); var befor =$(".c-banner .banner ul li").eq(nexImg); //将当前图片试用绝对定位,下一张图片试用相对定位 $(".c-banner .banner ul img").eq(nexImg).css("position","absolute"); $(".c-banner .banner ul img").eq(jumpImg).css("position","relative"); after.css("display","block"); after.stop().animate({"opacity":1},1000); befor.stop().animate({"opacity":0},1000,function(){ befor.css("display","none"); }); nexImg=jumpImg; } $(this).css("background-color","black"); time =setInterval(intervalImg,3000); }); }); //动态数据轮播图 //动态数据加载的时候不要直接点击demo.html运行否则可能请求不到本地json数据 // function dynamicData(){ // $.ajax({ // url:"js/test.json", // type:"get", // dataType:"json", // success:function(data){ // if(data.code==1){ // var data = data.data; // $.each(data,function(i){ // $(".c-banner .banner ul").append('<li><img src="'+this.img+'"></li>'); // $(".c-banner .jumpBtn ul").append('<li jumpImg="'+i+'"></li>') // }) // } // //获取图片总数量 // imgLength = $(".c-banner .banner ul li").length; // //为底部按钮定义单击事件 // $(".c-banner .jumpBtn ul li").each(function(){ // //为每个按钮定义点击事件 // $(this).click(function(){ // clearInterval(time); // $(".c-banner .jumpBtn ul li").css("background-color","white"); // jumpImg = $(this).attr("jumpImg"); // if(jumpImg!=nexImg){ // var after =$(".c-banner .banner ul li").eq(jumpImg); // var befor =$(".c-banner .banner ul li").eq(nexImg); // // //将当前图片试用绝对定位,下一张图片试用相对定位 // $(".c-banner .banner ul img").eq(nexImg).css("position","absolute"); // $(".c-banner .banner ul img").eq(jumpImg).css("position","relative"); // // after.css("display","block"); // after.stop().animate({"opacity":1},1000); // befor.stop().animate({"opacity":0},1000,function(){ // befor.css("display","none"); // }); // nexImg=jumpImg; // } // $(this).css("background-color","black"); // time =setInterval(intervalImg,3000); // }); // }); // } // }) // } </script> <div style="text-align:center;margin:10px 0; font:normal 14px/24px 'MicroSoft YaHei';"> </div> </body> </html> ``` ```
asp.net调用jqury失败,一直无法应用jqury插件
正常应该是![图片说明](https://img-ask.csdn.net/upload/201911/23/1574513764_767043.png) 但是一直无法应用js就变成了这样![图片说明](https://img-ask.csdn.net/upload/201911/23/1574513778_368569.png) using System.Web; using System.Web.Optimization; namespace Lin { public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/Login/js").Include( "~/Scripts/Login.js")); bundles.Add(new ScriptBundle("~/Index/bootstrap").Include( "~/Scripts/bootstrap.js")); bundles.Add(new ScriptBundle("~/Index/easing").Include( "~/Scripts/easing.js")); bundles.Add(new ScriptBundle("~/Index/jquery").Include( "~/Scripts/jquery-1.11.1.min.js")); bundles.Add(new ScriptBundle("~/Index/circlechart").Include( "~/Scripts/jquery.circlechart.js")); bundles.Add(new ScriptBundle("~/Index/flexslider").Include( "~/Scripts/jquery.flexslider.js")); bundles.Add(new ScriptBundle("~/Index/flipster").Include( "~/Scripts/jquery.flipster.js")); bundles.Add(new ScriptBundle("~/Index/jzBox").Include( "~/Scripts/jzBox.js")); bundles.Add(new ScriptBundle("~/Index/move-top").Include( "~/Scripts/move-top.js")); bundles.Add(new ScriptBundle("~/Index/SmoothScroll").Include( "~/Scripts/SmoothScroll.min.js")); bundles.Add(new StyleBundle("~/Login/css").Include( "~/Content/style_login.css")); bundles.Add(new StyleBundle("~/Index/fonts_1").Include( "~/Content/fonts_1.css")); bundles.Add(new StyleBundle("~/Index/fonts_2").Include( "~/Content/fonts_2.css")); bundles.Add(new StyleBundle("~/Index/bootstrap").Include( "~/Content/bootstrap.css")); bundles.Add(new StyleBundle("~/Index/flexslider").Include( "~/Content/flexslider.css")); bundles.Add(new StyleBundle("~/Index/flipster").Include( "~/Content/jquery.flipster.css")); bundles.Add(new StyleBundle("~/Index/style").Include( "~/Content/style.css")); } } } @{ Layout = null; } <!DOCTYPE html> <html> <head> <title>Index</title> <!-- Custom Theme files --> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script> <!-- //Custom Theme files --> @Styles.Render("~/Index/bootstrap") @Styles.Render("~/Index/style") @Styl @{ Layout = null; } <!DOCTYPE html> <html> <head> <title>About</title> <!-- Custom Theme files --> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script> <!-- //Custom Theme files --> @Styles.Render("~/Index/bootstrap") @Styles.Render("~/Index/style") @Styles.Render("~/Index/flipster") <!-- js --> @Scripts.Render("~/Index/jquery") @Scripts.Render("~/Index/SmoothScroll") <!-- //js --> <!-- web-fonts --> @Styles.Render("~/Index/fonts_1") @Styles.Render("~/Index/fonts_2") <!-- //web-fonts --> <!-- start-smooth-scrolling --> @Scripts.Render("~/Index/move-top") @Scripts.Render("~/Index/easing") <script type="text/javascript"> jQuery(document).ready(function ($) { $(".scroll").click(function (event) { event.preventDefault(); $('html,body').animate({ scrollTop: $(this.hash).offset().top }, 1000); }); }); </script> <!-- //end-smooth-scrolling --> </head> <body> <!-- header --> <div class="header"> <div class="container"> <nav class="navbar navbar-default"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <h1><a href="index.html">FTG格斗之家</a></h1> </div> <!-- top-nav --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li><a href="index.html" class="active">首页</a></li> <li><a href="about.html">我们</a></li> <li><a href="gallery.html">画廊</a></li> <li><a href="contact.html">联系我们</a></li> <li><a href="#">我的课程</a></li> <li><a href="#">注销</a></li> </ul> <div class="clearfix"> </div> </div> </nav> </div> </div> <!-- //header --> <!-- banner --> <div class="banner about-banner"> <div class="container"> <div class="banner-text"> <h2>About FTG</h2> </div> </div> </div> <!-- //banner --> <!-- about --> <div class="about agileits"> <div class="container"> <div class="w3ls-title"> <h3>关于我们</h3> </div> <div class="about-w3ls-row"> <div class="col-md-4 about-left"> <div class="pic"> <div class="stack twisted"> <img src="~/images/img2.jpg" alt=" " class="img-responsive"> </div> </div> </div> <div class="col-md-8 about-right"> <h5>FTG </h5> <p>我们致力于打造一个集训练与交流的一流俱乐部,我们在这里等待你的加入,我们期待你的加入。 </p> <!-- history --> <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> <div class="panel panel-default"> <div class="panel-heading" role="tab" id="headingOne"> <h4 class="panel-title asd"> <a class="pa_italic" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> 格斗爱好者聚集地 </a> </h4> </div> <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne"> <div class="panel-body panel_text"> 我们提供一流的服务给各位爱好格斗的朋友们,我们拥有舒适的场地,宽敞的格斗台,以及良好的交流环境,并且有免费的温泉。 </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading" role="tab" id="headingTwo"> <h4 class="panel-title asd"> <a class="pa_italic collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> 专业教学 </a> </h4> </div> <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo"> <div class="panel-body panel_text"> 如果您是初学者,不要担心,我们有专业的教练,配备有专业设施,并且有多项课程可以选择,根据自身基础进行选择。 </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading" role="tab" id="headingThree"> <h4 class="panel-title asd"> <a class="pa_italic collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> 我们的优势 </a> </h4> </div> <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree"> <div class="panel-body panel_text"> 在这里没有教练与学员,我们的教练全部都是专业资深培训师,但是他们与学员之间只有朋友关系,会以一个朋友的姿态来教学。 </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading" role="tab" id="headingFour"> <h4 class="panel-title asd"> <a class="pa_italic collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="false" aria-controls="collapseFour"> <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> 如何加入我们 </a> </h4> </div> <div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFour"> <div class="panel-body panel_text"> 可以直接来我们的俱乐部,我们会有引导人员,进行引导参观,我们的俱乐部全国连锁,具体地址可电188 8888 8888询问。 </div> </div> </div> </div> <!-- //history --> </div> <div class="clearfix"> </div> </div> </div> </div> <!-- //about --> <!-- about-slid --> <div class="about-slid"> <div class="container"> <div class="flipster"> <ul> <li> <div class="pricing"> <div class="pricing-top "> <h3>专项计划</h3> <p>$3000/月</p> </div> <div class="pricing-bottom"> <div class="pricing-bottom-top"> <p>泰拳类 : 6.00am - 7.00am</p> <p>健身房 : 7.05am - 8.00am</p> <p>举重类 : 8.05am - 9.00am </p> <p>自由搏击 : 9.05am - 10.00am</p> </div> <div class="pricing-bottom-bottom"> <p><span>HOT</span> Plan</p> </div> <div class="buy-button"> <a href="#">现在加入</a> </div> </div> </div> </li> <li> <div class="pricing"> <div class="pricing-top top-two"> <h3>基本计划</h3> <p>$500/月</p> </div> <div class="pricing-bottom"> <div class="pricing-bottom-top"> <p>泰拳 : 6.00am - 7.00am</p> <p class="display-none">健身房 : 7.05am - 8.00am</p> <p class="display-none">举重类 : 8.05am - 9.00am </p> <p class="display-none">自由搏击 : 9.05am - 10.00am</p> </div> <div class="pricing-bottom-bottom"> <p><span>A</span> Plan</p> </div> <div class="buy-button"> <a href="#">现在加入</a> </div> </div> </div> </li> <li> <div class="pricing"> <div class="pricing-top top-three"> <h3>标准计划</h3> <p>$1000/月</p> </div> <div class="pricing-bottom"> <div class="pricing-bottom-top"> <p>泰拳类 : 6.00am - 7.00am</p> <p>健身房 : 7.05am - 8.00am</p> <p class="display-none">举重类 : 8.05am - 9.00am </p> <p class="display-none">自由搏击 : 9.05am - 10.00am</p> </div> <div class="pricing-bottom-bottom"> <p><span>S</span> Plan</p> </div> <div class="buy-button"> <a href="#">现在加入</a> </div> </div> </div> </li> <li> <div class="pricing"> <div class="pricing-top top-four"> <h3>高级计划</h3> <p>$1300/月</p> </div> <div class="pricing-bottom"> <div class="pricing-bottom-top"> <p>泰拳类 : 6.00am - 7.00am</p> <p>健身房 : 7.05am - 8.00am</p> <p>举重类 : 8.05am - 9.00am </p> <p class="display-none">自由搏击 : 9.05am - 10.00am</p> </div> <div class="pricing-bottom-bottom"> <p><span>SS </span>Plan</p> </div> <div class="buy-button"> <a href="#">现在加入</a> </div> </div> </div> </li> <li> <div class="pricing"> <div class="pricing-top top-five"> <h3>快速计划</h3> <p>$2000/月</p> </div> <div class="pricing-bottom"> <div class="pricing-bottom-top"> <p>泰拳类 : 5.00am - 7.00am</p> <p>健身房 : 7.05am - 8.00am</p> <p>举重类 : 8.05am - 9.00am </p> <p>自由搏击 : 9.05am - 10.00am</p> </div> <div class="pricing-bottom-bottom"> <p><span>HOT</span> Plan</p> </div> <div class="buy-button"> <a href="#">现在加入</a> </div> </div> </div> </li> </ul> </div> @Scripts.Render("~/Index/flipster") <script> $(function () { $(".flipster").flipster({ style: 'carousel', start: 0 }); }); </script> </div> </div> <!-- //about-slid --> <!-- team --> <div class="team agileits"> <div class="team-info"> <div class="container"> <div class="w3ls-title"> <h3>我们的培训师</h3> </div> <div class="team-row"> <div class="col-md-3 team-grids"> <div class="team-img"> <img class="img-responsive" src="images/t1.jpg" alt=""> <div class="captn"> <div class="captn-top"> <h4>罗伯特·凯</h4> </div> <div class="social-icons"> <p>只有不肯做没有做不到</p> <div class="clearfix"> </div> </div> </div> </div> </div> <div class="col-md-3 team-grids"> <div class="team-img"> <img class="img-responsive" src="images/t2.jpg" alt=""> <div class="captn"> <div class="captn-top"> <h4>玛丽·莲</h4> </div> <div class="social-icons"> <p>我们不比任何人差</p> <div class="clearfix"> </div> </div> </div> </div> </div> <div class="col-md-3 team-grids"> <div class="team-img"> <img class="img-responsive" src="images/t3.jpg" alt=""> <div class="captn"> <div class="captn-top"> <h4>康斯坦丁</h4> </div> <div class="social-icons"> <p>你想来,我便等着你</p> <div class="clearfix"> </div> </div> </div> </div> </div> <div class="col-md-3 team-grids"> <div class="team-img"> <img class="img-responsive" src="images/t4.jpg" alt=""> <div class="captn"> <div class="captn-top"> <h4>琼斯·露</h4> </div> <div class="social-icons"> <p>只要有心,没有做不到的</p> <div class="clearfix"> </div> </div> </div> </div> </div> <div class="clearfix"> </div> </div> </div> </div> </div> <!-- //team --> <!-- map --> <div class="map"> <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3023.9503398796587!2d-73.9940307!3d40.719109700000004!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c25a27e2f24131%3A0x64ffc98d24069f02!2sCANADA!5e0!3m2!1sen!2sin!4v1441710758555"></iframe> <div class="address agileits"> <div class="w3ls-title"> <h3>GET IN TOUCH</h3> </div> <p>林, CH 10000, 杭州. </p> <p>手机 : 188 8888 8888</p> <p>QQ : 8888 8888 8</p> <p>Email : <a href="mailto:example@qq.com">888888888@qq.com</a></p> </div> </div> <!-- //map --> <!-- footer --> <div class="footer"> <div class="container"> <h3><a href="index.html">FTG格斗之家</a></h3> <p>我们期待着你的到来</p> </div> </div> <!-- //footer --> <!-- smooth-scrolling-of-move-up --> <script type="text/javascript"> $(document).ready(function () { var defaults = { containerID: 'toTop', // fading element id containerHoverID: 'toTopHover', // fading element hover id scrollSpeed: 1200, easingType: 'linear' }; $().UItoTop({ easingType: 'easeOutQuart' }); }); </script> <!-- //smooth-scrolling-of-move-up --> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> @Scripts.Render("~/Index/bootstrap") </body> </html> **_其中@Scripts.Render("~/Index/flipster") @Scripts.Render("~/Index/jquery")一直应用不上**_
我前端页面上传了视频到 项目的tomcat服务器上 ,数据库保存的地址,但是我在前期怎么访问这个视频啊。求大神指点
后台上传代码 ``` public int addCourseWare(HttpServletRequest request){ //解析请求中的数据 MultipartHttpServletRequest mpRequest = (MultipartHttpServletRequest) request; String courseWare_name = request.getParameter("courseWare_name"); String course_id =request.getParameter("course_name"); String courseWare_type = request.getParameter("courseWare_type"); String courseWare_introduction = request.getParameter("courseWare_introduction"); //将上传的数据写入CourseWareCnd对象 CourseWareCnd cnd = new CourseWareCnd(); cnd.setCourseWare_name(courseWare_name); cnd.setCourse_id(Integer.parseInt(course_id)); cnd.setCourseWare_type(courseWare_type); cnd.setCourseWare_introduction(courseWare_introduction); //获取上传文件的文件名 MultipartFile file = mpRequest.getFile("video"); String name = file.getOriginalFilename(); //获取项目路径 String ctxPath = request.getSession().getServletContext().getRealPath("/"); String path=ctxPath+name; cnd.setVideo(path); System.out.println("-------------"+path); File f = new File(ctxPath); if (!f.exists()) {//判断文件夹是否存在,不存在创建 f.mkdir(); } try { file.transferTo(new File(path));//将数据写到该位置 } catch (IOException e) { e.printStackTrace(); } int result = courseWareMapper.addCourseWare(cnd); return result; } ``` 前端HTML页面 ``` <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>视频播放</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#"> <i class="fa fa-wrench"></i> </a> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="player"> <video src=""> <!-- Video files --> Your browser does not support the video tag. <source src="http://localhost:8080" type="video/mp4"> <a href="">Download</a> </video> </div> </div> </div> ``` 我该怎么去获取这个视频啊,,,,,,, 第一次写这个视频的上传与播放 求大佬指点。。。。。。。。
jQuery toggle连续点击事件报错 "Uncaught TypeError: undefined is not a function"
<html> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="js/jquery2.js" ></script> <script> $(document).ready(function(){ $('#bd').toggle( function(){ $("body").css("background-color","aliceblue"); }, function(){ $("body").css("background-color","aquamarine"); }, function(){ $("body").css("background-color","bisque"); } ); }) </script> </head> <body id="bd"> <input id="bt1" type="button" value="ssss"/> </body> </html>
c:foreach循环出多个div如何控制单个div的显示隐藏
``` <c:forEach items="${requestScope.newList}" var="newList"> <!--消息 --> <div class="s-msg-item s-msg-temp i-msg-downup conceal1"> <h6 class="s-msg-bar"><span class="s-name">每日新闻</span></h6> <div class="s-msg-content i-msg-downup-wrap"> <div class="i-msg-downup-con"> <a class="i-markRead" target="_blank" href="/person/mynest/blog?blog=${newList.id}"> <img src="/static/images/${newList.pic}"> <p class="s-main-content"> ${newList.activityTitle} </p> <p class="s-row s-main-content"> <a href="/person/mynest/blog?blog=${newList.id}"> 阅读全文 <i class="am-icon-angle-right"></i> </a> </p> </a> </div> </div> <a class="i-btn-forkout conceal" ref="${newList.id}" href="javascript:;"><i class="am-icon-close am-icon-fw"></i></a> </div> </c:forEach> ``` jQuery代码 ``` $(function () { $(document).ready(function(){ $(".conceal").click(function(){ $(".conceal1").hide(); }); }); }); ``` 修改后: ``` <c:forEach items="${requestScope.newList}" var="newList"> <!--消息 --> <div class="s-msg-item s-msg-temp i-msg-downup conceal1" id="${newList.id}" onclick=hide(this)> <h6 class="s-msg-bar"><span class="s-name">每日新鲜事</span></h6> <div class="s-msg-content i-msg-downup-wrap"> <div class="i-msg-downup-con"> <a class="i-markRead" target="_blank" href="/person/mynest/blog?blog=${newList.id}"> <img src="/static/images/${newList.pic}"> <p class="s-main-content"> ${newList.activityTitle} </p> <p class="s-row s-main-content"> <a href="/person/mynest/blog?blog=${newList.id}"> 阅读全文 <i class="am-icon-angle-right"></i> </a> </p> </a> </div> </div> <a class="i-btn-forkout conceal" ref="${newList.id}" href="javascript:;"><i class="am-icon-close am-icon-fw"></i></a> </div> </c:forEach> ``` JS ``` function hide(obj){ $(obj).toggle(); } ``` >
Unity UGUI Toggle Group问题
单个toggle的话,Background和Checkmark设置不同的Sprite,点击toggle就可以切换自身的图片。应用到Toggl Group里就失效了?我需要做一个toggle group,里面有三个按钮,不允许switch off,被单击到的按钮会切换到高亮的图,按照单个toggle的做法的话,就失效了,有人知道为什么吗?或者该怎么做?
js怎么实现按钮值的循环改变
现在按钮显示为隐藏/显示,怎么能改成开始是隐藏,点击后变为显示,然后可以点击实现循环 ``` <!DOCTYPE html> <html> <head> <title></title> </head> <script src="js/jquery-1.10.2.min.js" type="text/javascript" charset="utf-8"></script> <script> $(function(){ $("#btn").click(function() { $("#content").toggle(); }); }); </script> <body> <button id="btn">隐藏/显示</button> <p id="content">也许明天,也许梦里,我重新拾起我最爱的诗,感动了所有的风和日丽</p> </body> </html> ```
想问一下如何在日历系统里插入图片
大二萌新做课设风景日历制作系统,图片不会插入,希望向各位大佬求助 ``` import java.awt.*; import java.awt.event.*; import java.util.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.table.*; public class MyCalendar extends JApplet { //定义星期天到星期六全局变量 public static final String WEEK_SUN = "星期日"; //星期标签名称 public static final String WEEK_MON = "星期一"; public static final String WEEK_TUE = "星期二"; public static final String WEEK_WED = "星期三"; public static final String WEEK_THU = "星期四"; public static final String WEEK_FRI = "星期五"; public static final String WEEK_SAT = "星期六"; public static final Color background = Color.white; //设置背景颜色 public static final Color foreground = Color.black; //设置前景颜色 public static final Color headerBackground = Color.blue; //设置题头星期的背景颜色 public static final Color headerForeground = Color.white; //设置题头星期的前景颜色 public static final Color selectedBackground = Color.green; //设置被选中的日期的背景颜色 public static final Color selectedForeground = Color.white; //设置被选中的日期的前景颜色 private JPanel cPane; //日历面板 private JLabel yearsLabel; //"年份"标签 private JSpinner yearsSpinner; //年调控,年份组合框 private JLabel monthsLabel; //"月份"标签 private JComboBox monthsComboBox;//12月下拉框 private JTable daysTable; //用来显示日期的table,日表格 private AbstractTableModel daysModel;//天单元表格 private Calendar calendar; //日历对象 //函数定义 public MyCalendar() { //构造函数 cPane = (JPanel) getContentPane(); } public void init() { //初始化,对所有的空间进行布局,面板界面函数 cPane.setLayout(new BorderLayout()); //使用border布局管理器 calendar = Calendar.getInstance();//默认方式,以本地的时区和地区来构造Calendar yearsLabel = new JLabel("年份: ");//设置年份标签显示 yearsSpinner = new JSpinner();//构造年份spinner组合框 yearsSpinner.setEditor(new JSpinner.NumberEditor(yearsSpinner, "0000")); yearsSpinner.setValue(new Integer(calendar.get(Calendar.YEAR))); //增加监听 监听年份的改变 yearsSpinner.addChangeListener(new ChangeListener() {//注册该组合框的事件监听器 public void stateChanged(ChangeEvent changeEvent) { int day = calendar.get(Calendar.DAY_OF_MONTH); calendar.set(Calendar.DAY_OF_MONTH, 1); calendar.set(Calendar.YEAR, ((Integer) yearsSpinner.getValue()).intValue()); int maxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); calendar.set(Calendar.DAY_OF_MONTH, day > maxDay ? maxDay : day); updateView();//更新显示 } }); JPanel yearMonthPanel = new JPanel();//定义年月面板 cPane.add(yearMonthPanel, BorderLayout.NORTH);//添加年月面板到日历面板的南面(最上方) yearMonthPanel.setLayout(new BorderLayout());//边布局模式 yearMonthPanel.add(new JPanel(), BorderLayout.CENTER); JPanel yearPanel = new JPanel();//构建年份面板 yearMonthPanel.add(yearPanel, BorderLayout.WEST);//年份面板添加到年月面板西部(左边) yearPanel.setLayout(new BorderLayout());//设置年份面板为边布局并添加年份标签和组合框 yearPanel.add(yearsLabel, BorderLayout.WEST); yearPanel.add(yearsSpinner, BorderLayout.CENTER); monthsLabel = new JLabel("月份: "); //设置月份标签显示 monthsComboBox = new JComboBox(); //向月份下拉框中增加内容 for (int i = 1; i <= 12; i++) { //构造下拉框的12个月份 monthsComboBox.addItem(new Integer(i)); } monthsComboBox.setSelectedIndex(calendar.get(Calendar.MONTH));//下拉框当前月份为选中状态 monthsComboBox.addActionListener(new ActionListener() { //注册月份下拉框的事件监听器 public void actionPerformed(ActionEvent actionEvent) { int day = calendar.get(Calendar.DAY_OF_MONTH); calendar.set(Calendar.DAY_OF_MONTH, 1); calendar.set(Calendar.MONTH, monthsComboBox.getSelectedIndex()); int maxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); calendar.set(Calendar.DAY_OF_MONTH, day > maxDay ? maxDay : day); updateView();//更新面板显示 } }); JPanel monthPanel = new JPanel();//定义月份面板 yearMonthPanel.add(monthPanel, BorderLayout.EAST);//添加月份面板到年月面板的东面(右面) monthPanel.setLayout(new BorderLayout());//月份面板设为边布局方式 monthPanel.add(monthsLabel, BorderLayout.WEST);//添加月份名称标签到月份面板西面(左面) monthPanel.add(monthsComboBox, BorderLayout.CENTER);//添加月份下拉框到月份面板中间 daysModel = new AbstractTableModel() { //设置7行7列 public int getRowCount() { //设置7行 return 7; } public int getColumnCount() { //设置列7 return 7; } public Object getValueAt(int row, int column) { if (row == 0) { //第一行显示星期 return getHeader(column); } row--; Calendar calendar = (Calendar) MyCalendar.this.calendar.clone(); calendar.set(Calendar.DAY_OF_MONTH, 1); int dayCount = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); int moreDayCount = calendar.get(Calendar.DAY_OF_WEEK) - 1; int index = row * 7 + column; int dayIndex = index - moreDayCount + 1; if (index < moreDayCount || dayIndex > dayCount) { return null; } else { return new Integer(dayIndex); } } }; daysTable = new CalendarTable(daysModel, calendar);//构造日表格 //设置每个call可以被选中 daysTable.setCellSelectionEnabled(true);//设置表格单元格可选择 daysTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); daysTable.setDefaultRenderer(daysTable.getColumnClass(0), new TableCellRenderer() { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { String text = (value == null) ? "" : value.toString(); JLabel cell = new JLabel(text); cell.setOpaque(true);//绘制边界内的所有像素 if (row == 0) {//第一行显示星期,设置为星期的前景色和背景色 cell.setForeground(headerForeground); cell.setBackground(headerBackground); } else { if (isSelected) {//日期单元格如果选中,则设置为日期选中的前、背景色 cell.setForeground(selectedForeground); cell.setBackground(selectedBackground); } else { //设置日期单元格的普通前、背景色 cell.setForeground(foreground); cell.setBackground(background); } } return cell; } }); updateView(); cPane.add(daysTable, BorderLayout.CENTER);//添加日面板到日历面板中间 } public static String getHeader(int index) {//设置第一行星期的显示 switch (index) { case 0: return WEEK_SUN; case 1: return WEEK_MON; case 2: return WEEK_TUE; case 3: return WEEK_WED; case 4: return WEEK_THU; case 5: return WEEK_FRI; case 6: return WEEK_SAT; default: return null; } } public void updateView() {//更新面板显示方法 daysModel.fireTableDataChanged(); daysTable.setRowSelectionInterval(calendar.get(Calendar.WEEK_OF_MONTH), calendar.get(Calendar.WEEK_OF_MONTH)); daysTable.setColumnSelectionInterval(calendar.get(Calendar.DAY_OF_WEEK) - 1, calendar.get(Calendar.DAY_OF_WEEK) - 1); } //设置日历的table public static class CalendarTable extends JTable {//表格类 private Calendar calendar; public CalendarTable(TableModel model, Calendar calendar) {//构造方法 super(model); this.calendar = calendar; } public void changeSelection(int row, int column, boolean toggle, boolean extend) {//选择表格单元格时 super.changeSelection(row, column, toggle, extend); if (row == 0) {//选择为第一行(星期)时不改变单元格 return; } Object obj = getValueAt(row, column); if (obj != null) { calendar.set(Calendar.DAY_OF_MONTH, ((Integer)obj).intValue()); } } } //让applet作为一个可执行的程序来运行 public static void main(String[] args) { JFrame frame = new JFrame("Calendar Application"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); MyCalendar myCalendar = new MyCalendar(); myCalendar.init(); frame.getContentPane().add(myCalendar); frame.setSize(400, 250); frame.show(); } } ```
想问一下java如何在日历系统里插入图片
大二做课设风景日历系统,做了半天也不会插入图片,更何况图片还要可供选择,求助各位大佬 ``` import java.awt.*; import java.awt.event.*; import java.util.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.table.*; ``` ``` public class MyCalendar extends JApplet { ``` public static final String WEEK_SUN = "星期日"; public static final String WEEK_MON = "星期一"; public static final String WEEK_TUE = "星期二"; public static final String WEEK_WED = "星期三"; public static final String WEEK_THU = "星期四"; public static final String WEEK_FRI = "星期五"; public static final String WEEK_SAT = "星期六"; public static final Color background = Color.white; public static final Color foreground = Color.black; public static final Color headerBackground = Color.blue; public static final Color headerForeground = Color.white; public static final Color selectedBackground = Color.green; public static final Color selectedForeground = Color.white; private JPanel cPane; private JLabel yearsLabel; private JSpinner yearsSpinner; private JLabel monthsLabel; private JComboBox monthsComboBox; private JTable daysTable; private AbstractTableModel daysModel; private Calendar calendar; //函数定义 public MyCalendar() { cPane = (JPanel) getContentPane(); } public void init() { cPane.setLayout(new BorderLayout()); calendar = Calendar.getInstance(); yearsLabel = new JLabel("年份: "); yearsSpinner = new JSpinner(); yearsSpinner.setEditor(new JSpinner.NumberEditor(yearsSpinner, "0000")); yearsSpinner.setValue(new Integer(calendar.get(Calendar.YEAR))); yearsSpinner.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent changeEvent) { int day = calendar.get(Calendar.DAY_OF_MONTH); calendar.set(Calendar.DAY_OF_MONTH, 1); calendar.set(Calendar.YEAR, ((Integer) yearsSpinner.getValue()).intValue()); int maxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); calendar.set(Calendar.DAY_OF_MONTH, day > maxDay ? maxDay : day); updateView(); } }); JPanel yearMonthPanel = new JPanel(); cPane.add(yearMonthPanel, BorderLayout.NORTH yearMonthPanel.setLayout(new BorderLayout());式 yearMonthPanel.add(new JPanel(), BorderLayout.CENTER) JPanel yearPanel = new JPanel(); yearMonthPanel.add(yearPanel, BorderLayout.WEST); yearPanel.setLayout(new BorderLayout()); yearPanel.add(yearsLabel, BorderLayout.WEST); yearPanel.add(yearsSpinner, BorderLayout.CENTER); monthsLabel = new JLabel("月份: "); monthsComboBox = new JComboBox(); for (int i = 1; i <= 12; i++) { monthsComboBox.addItem(new Integer(i)); } monthsComboBox.setSelectedIndex(calendar.get(Calendar.MONTH)); monthsComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { int day = calendar.get(Calendar.DAY_OF_MONTH); calendar.set(Calendar.DAY_OF_MONTH, 1); calendar.set(Calendar.MONTH, monthsComboBox.getSelectedIndex()); int maxDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); calendar.set(Calendar.DAY_OF_MONTH, day > maxDay ? maxDay : day); updateView(); } }); JPanel monthPanel = new JPanel(); yearMonthPanel.add(monthPanel, BorderLayout.EAST); monthPanel.setLayout(new BorderLayout()); monthPanel.add(monthsLabel, BorderLayout.WEST); monthPanel.add(monthsComboBox, BorderLayout.CENTER); daysModel = new AbstractTableModel() { public int getRowCount() { return 7; } public int getColumnCount() { return 7; } public Object getValueAt(int row, int column) { if (row == 0) { return getHeader(column); } row--; Calendar calendar = (Calendar) MyCalendar.this.calendar.clone(); calendar.set(Calendar.DAY_OF_MONTH, 1); int dayCount = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); int moreDayCount = calendar.get(Calendar.DAY_OF_WEEK) - 1; int index = row * 7 + column; int dayIndex = index - moreDayCount + 1; if (index < moreDayCount || dayIndex > dayCount) { return null; } else { return new Integer(dayIndex); } } }; daysTable = new CalendarTable(daysModel, calendar); daysTable.setCellSelectionEnabled(true); daysTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); daysTable.setDefaultRenderer(daysTable.getColumnClass(0), new TableCellRenderer() { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { String text = (value == null) ? "" : value.toString(); JLabel cell = new JLabel(text); cell.setOpaque(true);// if (row == 0) { cell.setForeground(headerForeground); cell.setBackground(headerBackground); } else { if (isSelected) { cell.setForeground(selectedForeground); cell.setBackground(selectedBackground); } else { cell.setForeground(foreground); cell.setBackground(background); } } return cell; } }); updateView(); cPane.add(daysTable, BorderLayout.CENTER); } public static String getHeader(int index) { switch (index) { case 0: return WEEK_SUN; case 1: return WEEK_MON; case 2: return WEEK_TUE; case 3: return WEEK_WED; case 4: return WEEK_THU; case 5: return WEEK_FRI; case 6: return WEEK_SAT; default: return null; } } public void updateView() {//更新面板显示方法 daysModel.fireTableDataChanged(); daysTable.setRowSelectionInterval(calendar.get(Calendar.WEEK_OF_MONTH), calendar.get(Calendar.WEEK_OF_MONTH)); daysTable.setColumnSelectionInterval(calendar.get(Calendar.DAY_OF_WEEK) - 1, calendar.get(Calendar.DAY_OF_WEEK) - 1); } // public static class CalendarTable extends JTable { private Calendar calendar; public CalendarTable(TableModel model, Calendar calendar) {// super(model); this.calendar = calendar; } public void changeSelection(int row, int column, boolean toggle, boolean extend) {//选择表格单元格时 super.changeSelection(row, column, toggle, extend); return; } Object obj = getValueAt(row, column); if (obj != null) { calendar.set(Calendar.DAY_OF_MONTH, ((Integer)obj).intValue()); } } } public static void main(String[] args) { JFrame frame = new JFrame("Calendar Application"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); MyCalendar myCalendar = new MyCalendar(); myCalendar.init(); frame.getContentPane().add(myCalendar); frame.setSize(400, 300); frame.show(); }
请问以下大家Lua中怎么添加Unity中的Toggle的事件
- 请问以下大家Lua中怎么添加Unity中的Toggle的事件,因为Toggle的事件是个泛型委托 - Toggle事件的委托`AddListener(UnityAction<T0> call);` - Button事件的委托`AddListener(UnityAction call);` - 我尝试了一下只能添加Button的事件 以下是我添加Toggle事件的lua代码 ```lua toggle.onValueChanged:AddListener(self.UpdateClothes); function ClothesTagView:UpdateClothes(isON) end ``` 报的错 ``` LuaException: c# exception:System.InvalidCastException: This type must add to CSharpCallLua: UnityEngine.Events.UnityAction<bool> ``` 以下是我添加Button事件的代码 ``` button.onClick:AddListener(self.UpdateClothes2) function ClothesTagView:UpdateClothes2() ClothesTagView:UpdateData() end ``` 是正常的可以使用,点击可以触发事件
ko(knockoutjs) + bootstrap,一个data-toggle属性的问题
knockoutjs + bootstrap 结合使用的时候, ko的foreach循环里,使用bootstrap的data-toggle属性,则data-toggle效果被屏蔽了。 ![图片说明](https://img-ask.csdn.net/upload/201501/17/1421488290_70898.png) -----------------------华丽的图片分割线-------------------------------- ![图片说明](https://img-ask.csdn.net/upload/201501/17/1421488346_644001.png) 如上图所示, 源代码这样: ``` <button type="button" class="btn btn-default" data-toggle="tooltip" title="Tooltip on top">Tooltip on top</button> <!-- ko foreach: DataList --> <button type="button" class="btn btn-default" data-toggle="tooltip" title="Tooltip on top">Tooltip on top</button> <!-- /ko --> ``` 真的很郁闷,bootstrap的data-toggle属性怎么在ko的foreach里使用呢?
数据库连接断开后还有操作的异常
用的springmvc+c3p0连接池,服务器tomcat,内存不是很大。 在其中某个模块的一些功能访问时,间歇性的会出现以下这种错误,基本都是:数据库链接断开后还有动作执行。随后就是OOM,服务器崩溃。 ERROR - 2015-10-08 09:07:24.187; org.hibernate.transaction.JDBCTransaction; JDBC rollback failed com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. ​Caused by: java.lang.OutOfMemoryError: Java heap space ERROR - 2015-10-08 09:07:24.187; org.hibernate.transaction.JDBCTransaction; Could not toggle autocommit com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. ​ 下面是刚刚报错的异常栈 ERROR - 2015-10-08 14:11:43.203; org.springframework.transaction.interceptor.TransactionAspectSupport; Application exception overridden by rollback exception org.hibernate.exception.JDBCConnectionException: could not load an entity: [net.shopxx.goodsmanagement.entity.GoodsShelve#12] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:99) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.loader.Loader.loadEntity(Loader.java:2041) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76) at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3294) at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:147) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090) at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1026) at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:176) at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215) at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190) at net.shopxx.goodsmanagement.entity.GoodsShelve_$$_javassist_19.getShopManagerInfo(GoodsShelve_$$_javassist_19.java) at net.shopxx.service.impl.OrderServiceImpl.build(OrderServiceImpl.java:562) at net.shopxx.service.impl.OrderServiceImpl.create(OrderServiceImpl.java:825) at net.shopxx.service.impl.OrderServiceImpl.updateOrder(OrderServiceImpl.java:2117) at net.shopxx.service.impl.OrderServiceImpl$$FastClassByCGLIB$$42b70035.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631) at net.shopxx.service.impl.OrderServiceImpl$$EnhancerByCGLIB$$ed32199c.updateOrder(<generated>) at net.shopxx.zdlengineer.controller.ClientOrderController.updateOrder(ClientOrderController.java:342) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.planetj.servlet.filter.compression.CompressingFilter.doFilter(CompressingFilter.java:270) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at net.shopxx.filter.SiteStatusFilter.doFilterInternal(SiteStatusFilter.java:50) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 0 milliseconds ago. The last packet sent successfully to the server was 271,625 milliseconds ago. ... 77 more Caused by: java.io.EOFException: Can not read response from server. Expected to read 5,349 bytes, read 1,362 bytes before connection was unexpectedly lost. at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:3119) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3626) ... 95 more
[Vue warn]: Error compiling template 請問如何處理
vue.esm.js?efeb:628 [Vue warn]: Error compiling template: text "">" outside root element will be ignored. template: ` <div id="app“> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Project name</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Home</a></li> <li><a href="#about">About</a></li> <li><a href="#contact">Contact</a></li> </ul> </div><!--/.nav-collapse --> </div> </nav> <router-view></router-view> </div>` }).$mount("#app")
flask开发动态创建多选框并勾选默认值,且传到后台怎么做?
场景如下: 单击按钮1弹出div1,显示的div1根据列表长度动态创建多选框,且判断值勾选默认值。 该div1中的多选框可修改,需要将修改后的值通过script传到路由,但是传值时的变量个数时不确定的,因此,有什么解决方案么? 大佬可以给个demo么?调通给采纳,感谢! ``` <div type='button' data-toggle="modal" data-target="#div1">按钮1</div> <div id='div1'> {% for i in [列表] %} {% if i=='某变量' %} <div> <label> <input id={{ i.name }} type="checkbox" checked>xxx </label> </div> {% else %} <div> <label> <input id={{ i.name }} type="checkbox">xxx </label> </div> {% endif %} {% endfor %} <div> <button id="按钮2" type="button>按钮2</button> </div> </div> <script> $(document).ready(function(){ $('#按钮2').click(function{ var is_x = $('#此处相对应上面多选框中的id名,但这个id名是个变量,而且个数是未知的').prop('checked') ? 2: 1; var is_y = .....个数未知,且名字未知 $.ajax({ type : 'POST', url : , data : JSON.stringfy({ is_x : is_x, is_y : is_y, ......个数未知,且名字未知 }) }); }); }); <script> ```
相见恨晚的超实用网站
相见恨晚的超实用网站 持续更新中。。。
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载 点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。 ...
字节跳动视频编解码面经
三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时想着能进去就不错了,管他哪个岗呢,就同意了面试...
开源一个功能完整的SpringBoot项目框架
福利来了,给大家带来一个福利。 最近想了解一下有关Spring Boot的开源项目,看了很多开源的框架,大多是一些demo或者是一个未成形的项目,基本功能都不完整,尤其是用户权限和菜单方面几乎没有完整的。 想到我之前做的框架,里面通用模块有:用户模块,权限模块,菜单模块,功能模块也齐全了,每一个功能都是完整的。 打算把这个框架分享出来,供大家使用和学习。 为什么用框架? 框架可以学习整体...
源码阅读(19):Java中主要的Map结构——HashMap容器(下1)
HashMap容器从字面的理解就是,基于Hash算法构造的Map容器。从数据结构的知识体系来说,HashMap容器是散列表在Java中的具体表达(并非线性表结构)。具体来说就是,利用K-V键值对中键对象的某个属性(默认使用该对象的“内存起始位置”这一属性)作为计算依据进行哈希计算(调用hashCode方法),然后再以计算后的返回值为依据,将当前K-V键值对在符合HashMap容器构造原则的基础上,放置到HashMap容器的某个位置上,且这个位置和之前添加的K-V键值对的存储位置完全独立,不一定构成连续的存储
c++制作的植物大战僵尸,开源,一代二代结合游戏
此游戏全部由本人自己制作完成。游戏大部分的素材来源于原版游戏素材,少部分搜集于网络,以及自己制作。 此游戏为同人游戏而且仅供学习交流使用,任何人未经授权,不得对本游戏进行更改、盗用等,否则后果自负。目前有六种僵尸和六种植物,植物和僵尸的动画都是本人做的。qq:2117610943 开源代码下载 提取码:3vzm 点击下载--&gt; 11月28日 新增四种植物 统一植物画风,全部修...
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
Python——画一棵漂亮的樱花树(不同种樱花+玫瑰+圣诞树喔)
最近翻到一篇知乎,上面有不少用Python(大多是turtle库)绘制的树图,感觉很漂亮,我整理了一下,挑了一些我觉得不错的代码分享给大家(这些我都测试过,确实可以生成) one 樱花树 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch, ...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
Python 基础(一):入门必备知识
Python 入门必备知识,你都掌握了吗?
深度学习图像算法在内容安全领域的应用
互联网给人们生活带来便利的同时也隐含了大量不良信息,防范互联网平台有害内容传播引起了多方面的高度关注。本次演讲从技术层面分享网易易盾在内容安全领域的算法实践经验,包括深度...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 cpp 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7 p...
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看...
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
Python 编程实用技巧
Python是一门很灵活的语言,也有很多实用的方法,有时候实现一个功能可以用多种方法实现,我这里总结了一些常用的方法,并会持续更新。
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
"狗屁不通文章生成器"登顶GitHub热榜,分分钟写出万字形式主义大作
前言 GitHub 被誉为全球最大的同性交友网站,……,陪伴我们已经走过 10+ 年时间,它托管了大量的软件代码,同时也承载了程序员无尽的欢乐。 上周给大家分享了一篇10个让你笑的合不拢嘴的Github项目,而且还拿了7万+个Star哦,有兴趣的朋友,可以看看, 印象最深刻的是 “ 呼吸不止,码字不停 ”: 老实交代,你是不是经常准备写个技术博客,打开word后瞬间灵感便秘,码不出字? 有什么
推荐几款比较实用的工具,网站
1.盘百度PanDownload 这个云盘工具是免费的,可以进行资源搜索,提速(偶尔会抽风????) 不要去某站买付费的???? PanDownload下载地址 2.BeJSON 这是一款拥有各种在线工具的网站,推荐它的主要原因是网站简洁,功能齐全,广告相比其他广告好太多了 bejson网站 3.二维码美化 这个网站的二维码美化很好看,网站界面也很...
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
相关热词 如何提升c#开发能力 矩阵乘法c# c#调用谷歌浏览器 c# 去空格去转义符 c#用户登录窗体代码 c# 流 c# linux 可视化 c# mvc 返回图片 c# 像素空间 c# 日期 最后一天
立即提问