基于servlet jsp页面查询条件回显及分页

在公司之前的老项目上完善新功能,纯servlet jsp页面,
做条件查询时不能回显查询条件,我在后台把前台数据接收后存在session中,然后从jsp页面直接取,但是结果每次回显的是我上一次的查询,也就是我查询"2"的时候,回显的是"1",大神给看看是
另外就是目前条件查询后点击下一页,又把所有的数据查出来了.图片说明
action 是执行当前页面,页面中有个方法查询数据库图片说明

图片说明图片说明
最后一张图是后台代码.搞了一下午,我感觉条件查询后分页就办法实现,不知道大佬们有什么解决思路
后台没有按照dao service action分开写,所有的业务都写在一个class里,包括sql语句

1个回答

1.你的分页查询时,sql语句中需要指定查询到记录位置,使用limit
2.上面的图中显示你的页号的变化发生在查询之后.
3.代码粘贴的太少了

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
请问如何实现jsp页面先分类后分页?
使用eclipse和tomca,暂时无其他框架,数据在oracle数据库中。 如何实现先分类后分页? 拿淘宝网举例,先得到一种商品,再进行分页显示。 这种实现需要从jsp页面得到“商品类型”和“当前页数”两个参数,但是点击下一页后,商品类型无法跟随传入servlet中,也就是说两个参数只能传一个到servlet中。 请问该如何解决只点击一项,却能同时传 两个参数的问题。
jsp+servlet实现分页
我在做jsp+servlet数据分页的时候,无法实现前后翻页, 下面是我的分层结构 jsp [code="java"] <%@page contentType="text/html;charset=gbk" %> <%@page language="java" import="java.util.*" %> <%@ include file="inc/cmnAuthenticate.jsp" %> <%@page language="java" import="ch05.*" %> <% Vector vMails = null; int totalPage=0; int curPage=0; int countPerPage=10; int pageNumber=1; Hashtable myValues = (Hashtable)session.getAttribute(CommonConst.VIEWID_INBOXLIST); if ( myValues != null ) { vMails = (Vector)myValues.get("mails"); if ( vMails == null ) { vMails = new Vector(); } if(myValues.get("totalPage")!=null){ totalPage=((Integer)myValues.get("totalPage")).intValue(); } if(myValues.get("curPage")!=null){ curPage=((Integer)myValues.get("curPage")).intValue(); } } %> <html> <head> <title>收件箱</title> <meta http-equiv="Content-Type" content="text/html; charset=gbk"> <script language="JAVASCRIPT" src="common\cmnScript.js"></script> <script language="JAVASCRIPT" src="inbox.js"></script> <link rel="stylesheet" type="text/css" href="common\cmnStyle.css" TITLE="common"></link> <script language="JAVASCRIPT"> <% if ( session.getAttribute("errMsg") != null ) { %> var sErrMsg = "<%=session.getAttribute("errMsg")%>"; <% } else { %> var sErrMsg = ""; <% } %> </script> </head> <%@ include file="inc/cmnPagePart1.jsp" %> <table border=0 cellpadding=0 cellspacing=0 width=650 align=center> <tr> <td height=15>&nbsp;</td> </tr> <tr> <td height=30>你当前共有 <font color=blue><%=vMails.size()%></font> 封邮件。</td> </tr> <tr> <td> <table border=1 bordercolor="#13A7FD" cellpadding=2 cellspacing=0 width=650 align=center> <tr> <td width=130> <b>发件人</b> </td> <td width=400> <b>主题</b> </td> <td width=120> <b>发信时间</b> </td> </tr> <% if ( vMails.size() > 0 ) { for ( int i=0; i<vMails.size(); i++ ) { if(i<countPerPage){ MailContent mailContent = (MailContent)vMails.get(i); String sFrom = mailContent.getSender(); String sSubject = mailContent.getSubject(); String sSendTime = mailContent.getSendTime(); String sReadFlg = mailContent.getReadFlg(); if ( sReadFlg.equals("0") ) { %> <tr> <td> <b><%=sFrom%></b> </td> <td> <b><a href="javascript:gotoMail('<%=i%>')"><%=sSubject%></a></b> </td> <td> <%=sSendTime%> </td> </tr> <% } else { %> <tr> <td> <%=sFrom%> </td> <td> <a href="javascript:gotoMail('<%=i%>')"><%=sSubject%></a> </td> <td> <%=sSendTime%> </td> </tr> <% } } } } else { %> <tr> <td colspan=3> 没有任何邮件! </td> </tr> <% } %> </table> </td> </tr> <tr> <td height=20>&nbsp;</td> </tr> </table> <form name="form_main" action="servlet/Inbox" method="post" > <input type="hidden" name="mailIndex" value=""> <div align="right"> 共 <font color=blue><%=totalPage%></font> 页,当前是第 <font color=blue><%=(totalPage==0?0:curPage+1)%></font> 页 &nbsp; <% if ( curPage > 0 ) { %> <a href="javascript: gotoPagePosition('0')">首页</a> &nbsp; <a href="javascript: gotoPagePosition('<%=curPage-1%>')">前一页</a> &nbsp; <% } else { %> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <% } if ( curPage < totalPage-1 ) { %> <a href="javascript: gotoPagePosition('<%=curPage+1%>')">后一页</a> &nbsp; <a href="javascript: gotoPagePosition('<%=totalPage-1%>')">末页</a> &nbsp; <% } else { %> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <% } %> <input type="hidden" name="pageId" value="S0101"> <input type="hidden" name="gotoPageNo" value=""> </div> </form> <%@ include file="inc/cmnPagePart2.jsp" %> [/code] servlet [code="java"]/* * This product includes software developed by the * Apache Software Foundation (http://www.apache.org/). */ package ch05.controller; import java.io.*; import java.util.Hashtable; import javax.servlet.*; import javax.servlet.http.*; import ch05.*; import ch05.module.*; /** * 针对收件箱页面的Servlet * @author Administrator * @version 1.0 */ public class Inbox extends HttpServlet implements java.io.Serializable { /** * */ private static final long serialVersionUID = 1L; public void doGet ( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException { //设置提交表单的中文编码 request.setCharacterEncoding("GBK"); HttpSession mySession = request.getSession(true); //清空错误消息 mySession.setAttribute("errMsg",""); //是否非法进入本页面 if ( mySession.getAttribute("username") == null ) { response.sendRedirect("/ch05/login.jsp"); return; } //是否进入默认页面 if ( !request.getParameterNames().hasMoreElements() ) { //设置session中的页面值域 mySession.setAttribute(CommonConst.VIEWID_INBOXLIST, new Hashtable() ); //取得最新邮件 MInbox mInbox = new MInbox(); boolean bGetResult = mInbox.getNewestMail( mySession ); String sGotoPage = request.getParameter("gotoPageNo"); Hashtable myValues = (Hashtable)mySession.getAttribute(ch05.CommonConst.VIEWID_INBOXLIST); myValues.put( "curPage", new Integer(sGotoPage) ); mySession.setAttribute("curPage","inbox"); response.sendRedirect("/ch05/inbox.jsp"); return; } //得到用户输入信息 String sMailIndex = request.getParameter("mailIndex"); String sMailOption = request.getParameter("mailOption"); //如果用户是提交表单 if ( sMailIndex != null && sMailIndex.length() > 0 ) { //设置session中的详细页面值域 mySession.setAttribute(CommonConst.VIEWID_INBOXDETAIL, new Hashtable() ); //获得对应的邮件信息 MInbox mInbox = new MInbox(); boolean bGetResult = mInbox.getDetailMail( mySession, sMailIndex ); if ( bGetResult ) { response.sendRedirect("/ch05/inboxDetail.jsp"); } else { response.sendRedirect("/ch05/inbox.jsp"); } } //如果用户是从详细页面迁移过来的 else if ( sMailOption != null && sMailOption.length() > 0 ) { String sSender = request.getParameter("sender"); String sSendTime = request.getParameter("sendTime"); String sSubject = request.getParameter("subject"); String sContent = request.getParameter("content"); //删除邮件 if ( sMailOption.equals("delete") ) { MInbox mInbox = new MInbox(); boolean bDeleteResult = mInbox.deleteMail( mySession, sSender, sSendTime ); mInbox.getNewestMail( mySession ); response.sendRedirect("/ch05/inbox.jsp"); return; } //回复邮件 else if ( sMailOption.equals("reply") ) { //设置session中的写邮件页面值域 mySession.setAttribute(CommonConst.VIEWID_SENDBOXDETAIL, new Hashtable() ); MInbox mInbox = new MInbox(); boolean bReplyResult = mInbox.replyMail( mySession, sSender, sSubject, sContent ); mySession.setAttribute("curPage","composite"); response.sendRedirect("/ch05/composite.jsp"); return; } try { MInbox mInbox=new MInbox(); mInbox.gotoPage(request, response); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } //如果用户非法进入这个页面 else { response.sendRedirect("/ch05/login.jsp"); } } public void doPost ( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException { doGet( request, response ); } }[/code] 数据库处理 [code="java"]/* * This product includes software developed by the * Apache Software Foundation (http://www.apache.org/). */ package ch05.module; import java.sql.*; import java.util.*; import java.text.*; import javax.mail.*; import javax.mail.internet.*; import javax.servlet.http.*; import ch05.*; /** * 针对收件箱页面的后台处理类 * @author Administrator * @version 1.0 */ public class MInbox { public boolean getNewestMail ( HttpSession mySession ) { //设置用户信息用 Hashtable myValues = (Hashtable)mySession.getAttribute(CommonConst.VIEWID_INBOXLIST); String sHost = ""; String sUser = ""; String sPass = ""; //尝试查找用户邮箱设置 try { //载入SQLServer的JDBC驱动类 Class.forName(CommonConst.DB_DRIVER_CLASSNAME); //获得数据库连接 Connection conn = DriverManager.getConnection( CommonConst.DB_CONN_STRING ); Statement stmt = null; ResultSet rs = null; String sUsername = (String)mySession.getAttribute("username"); try { //设置数据库的rollback点 conn.setAutoCommit(false); //检查数据库中是否已经有该用户的邮箱设置 stmt = conn.createStatement(); //执行SQL语句 String sQuery = "select * from mail_setting where username='" + sUsername + "'"; rs = stmt.executeQuery( sQuery ); if (rs.next() ) { sHost = rs.getString(2); sUser = rs.getString(3); sPass = rs.getString(4); } else { mySession.setAttribute("errMsg","请首先进行邮箱设置!"); return false; } //尝试连接Pop3服务器 Properties props = System.getProperties(); Session session = Session.getDefaultInstance(props, null); //获得收件箱 Store store = session.getStore("pop3"); store.connect( sHost, sUser, sPass); //获得Folder,并按照只读打开 Folder folder = store.getFolder( "INBOX" ); folder.open( Folder.READ_WRITE ); //获得所有邮件,并依次获取内容 Message messages[] = folder.getMessages(); //往数据库中登录 for ( int i=0; i<messages.length; i++ ) { //只要不是html格式,大概没有乱码问题。。。 String sFrom = MailContent.getFrom( messages[i].getFrom()[0].toString() ); String sTo = MailContent.getFrom( messages[i].getRecipients( Message.RecipientType.TO )[0].toString() ); String sDate = (new SimpleDateFormat("yyyy/MM/dd HH:mm:ss")).format(messages[i].getSentDate()); String sSubject = messages[i].getSubject(); String sContent = ""; //如果纯文本邮件内容 if ( messages[i].getContent() instanceof String ) { sContent = (String) messages[i].getContent(); } //如果HTML格式邮件内容 else { sContent = ((MimeMultipart)messages[i].getContent()).getBodyPart(0).getContent().toString(); } //插入数据库 String sUpdateQuery = "insert into inbox values('" + sUsername + "', '" + sFrom + "', '" + sTo + "', '" + sDate + "', '" + sSubject + "', '" + sContent + "', '0') "; stmt.executeUpdate( sUpdateQuery ); } conn.commit(); conn.setAutoCommit(true); //删除服务器上的邮件 for ( int i=0; i<messages.length; i++ ) { messages[i].setFlag( Flags.Flag.DELETED, true ); } folder.close(true); store.close(); //重新获取数据库中的所有邮件,并表示在页面上 Vector vMails = new Vector(); sQuery = "select * from inbox where username='" + sUsername + "' order by send_time desc"; rs = stmt.executeQuery( sQuery ); while ( rs.next() ) { String sFrom = rs.getString(2); String sTo = rs.getString(3); String sDate = rs.getString(4); String sSubject = rs.getString(5); String sContent = rs.getString(6); String sReadFlg = rs.getString(7); MailContent mc = new MailContent(); mc.setSender(sFrom); mc.setReceiver(sTo); mc.setSendTime(sDate); mc.setSubject(sSubject); mc.setContent(sContent); mc.setReadFlg(sReadFlg); vMails.add( mc ); } myValues.put( "mails", vMails ); //计算总页数 int countPerPage=10; int totalMail=vMails.size(); int totalPage=0; if(totalMail%countPerPage==0){ totalPage=totalMail/countPerPage; } else{ totalPage=totalMail/countPerPage+1; } int curPage=0; myValues.put("curPage", new Integer(curPage)); myValues.put("totalPage", new Integer(totalPage)); } catch(Exception e) { e.printStackTrace(); mySession.setAttribute("errMsg","查找邮件时出现错误!"); return false; } finally { try { rs.close(); stmt.close(); }catch(Exception ex) { } } }catch(Exception ex) { ex.printStackTrace(); mySession.setAttribute("errMsg","查找邮件时出现错误!"); return false; } return true; } } }[/code] js [code="java"]window.onload = windowLoad; //--------------------------------- //页面载入时调用 function windowLoad() { cmnWindowLoad(); } //查看具体邮件 function gotoMail( index ) { form_main.mailIndex.value = index; form_main.submit(); } //前后翻页 function gotoPagePosition( gotoCount ) { form_main.pageId.value = "goto"; form_main.gotoPageNo.value = gotoCount; form_main.submit(); }[/code]
关于在jsp界面中使用bootstrap-table插件的分页问题
最近在做一个比较大的项目,用了bootstrap-table这个插件来处理表格,方便很多。但是在分页的时候,不知道前端jsp界面和后端servlet分别怎么写。后端是不是只要传递json给前端就可以,前端分页怎么发送请求到后端?求大神指教,很着急!!!
jsp+servlet+sqlserver分页,前台获取的ID总为每一页信息的最后一项的ID?
# 求教大神:JSP+servlet+sqlserver分页查询后,在页面获取ID时,不管点击哪一项,传到后台的ID值都为每一页信息的最后一项的ID? ![这是前台页面](https://img-ask.csdn.net/upload/201704/12/1491958509_846310.png) serverlt代码: int pageIndex = 1;//页数 int pageCount = 0;//总页数 int count = 0;//总数据条数 Session session = HibernateUtil.openSession(); //数据总条数查询 SQLQuery sqlquery1 = session.createSQLQuery("select count(userID) from t_user"); List<Integer> numList = sqlquery1.list(); count = numList.get(0); pageCount = count/20+(count/20!=0?1:0);//总页数 //按钮处理分页 String indexnum = request.getParameter("pageindex"); if(indexnum!=null&&Integer.parseInt(indexnum)<=pageCount&&Integer.parseInt(indexnum)>0){ pageIndex = Integer.parseInt(indexnum); } //数据查询 SQLQuery sqlquery = session.createSQLQuery("select top 20 " + "u.userID,u.name,ad.address, ad.communityID,c.community,ad.building,ad.unit,ad.houseNum,u.phone,u.openDate,u.chageDate,u.isPrePaid,u.buyTimes "+ " from t_user as u left join t_address as ad on u.addressID=ad.addressID left join t_area as ar on ad.areaID=ar.areaID "+ " left join t_community as c on c.communityID=ad.communityID " +"where userID not in (select top "+20*(pageIndex-1)+" userID from t_user ) order by userID"); List<Object[]> olist = sqlquery.list(); //将要显示的字段传到userInfo.jsp request.setAttribute("olist", olist);//用户信息 request.setAttribute("count", count);//数据总条数 request.setAttribute("pageCount", pageCount);//数据总页数 request.setAttribute("pageIndex", pageIndex);//当前页数 request.getRequestDispatcher("userInfo.jsp").forward(request, response); ``` 前端代码: <c:forEach items="${olist }" var="o" > <tr> <td height="20" bgcolor="#FFFFFF"><div align="center"> <input type="checkbox" name="checkbox2" value="checkbox" /> </div></td> <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE1"> <div align="center">${o[0] }</div> </div></td> <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${o[1] }</span></div></td> <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${o[2] }</span></div></td> <td bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${o[3] }</span></div></td> <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${o[4] }</span></div></td> <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${o[5] }</span></div></td> <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${o[6] }</span></div></td> <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${o[7] }</span></div></td> <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${o[8] }</span></div></td> <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${o[9] }</span></div></td> <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${o[10] }</span></div></td> <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${o[11] }</span></div></td> <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">${o[12] }</span></div></td> <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE4"> <a><img src="images/edt.gif" width="13" height="13" />编辑</a>&nbsp; <a href="#" onclick="del()"><img src="images/del.gif" width="13" height="13" />删除</a> <script> function del(){ if(window.confirm("是否删除用户?")==true){ window.location.href="moduser?type=2&id="+${o[0] }; } } </script> </span></div></td> </tr> # </c:forEach> ```
jsp+servlet实现分页,没有报错,但出来值?
![图片说明](https://img-ask.csdn.net/upload/201702/01/1485952224_347187.jpg) ![图片说明](https://img-ask.csdn.net/upload/201702/01/1485952159_353121.jpg) ![图片说明](https://img-ask.csdn.net/upload/201702/01/1485952130_597395.jpg)
淘淘商城运行users.jsp页面出现400错误。
![图片说明](https://img-ask.csdn.net/upload/201909/12/1568267628_637428.png) 上面的是项目的的文件列表。 cn.itcast.usermanage.controller包 PageController.java文件代码 ``` package cn.itcast.usermanage.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; /** * 通用的页面跳转逻辑 * * @author * */ @Controller @RequestMapping("page") public class PageController { /** * 具体的跳转页面逻辑 -- test4 * * @param pageName * @return 视图名 */ @RequestMapping(value = "{pageName}", method = RequestMethod.GET) public String toPage(@PathVariable("pageName") String pageName) { return pageName; } } ``` mybatis.xml代码 ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <plugins> <!-- 分页助手 --> <plugin interceptor="com.github.pagehelper.PageHelper"> <property name="dialect" value="mysql" /> <!-- 该参数默认为false --> <!-- 设置为true时,使用RowBounds分页会进行count查询 --> <property name="rowBoundsWithCount" value="true" /> </plugin> <!-- 通用mapper --> <plugin interceptor="com.github.abel533.mapperhelper.MapperInterceptor"> <!--主键自增回写方法,默认值MYSQL,详细说明请看文档 --> <property name="IDENTITY" value="MYSQL" /> <!--通用Mapper接口,多个通用接口用逗号隔开 --> <property name="mappers" value="com.github.abel533.mapper.Mapper" /> </plugin> </plugins> </configuration> ``` spring文件代码区 applicationContext-mybatis.xml文件代码区 ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <plugins> <!-- 分页助手 --> <plugin interceptor="com.github.pagehelper.PageHelper"> <property name="dialect" value="mysql" /> <!-- 该参数默认为false --> <!-- 设置为true时,使用RowBounds分页会进行count查询 --> <property name="rowBoundsWithCount" value="true" /> </plugin> <!-- 通用mapper --> <plugin interceptor="com.github.abel533.mapperhelper.MapperInterceptor"> <!--主键自增回写方法,默认值MYSQL,详细说明请看文档 --> <property name="IDENTITY" value="MYSQL" /> <!--通用Mapper接口,多个通用接口用逗号隔开 --> <property name="mappers" value="com.github.abel533.mapper.Mapper" /> </plugin> </plugins> </configuration> ``` applicationContext-transaction.xml代码区 ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <plugins> <!-- 分页助手 --> <plugin interceptor="com.github.pagehelper.PageHelper"> <property name="dialect" value="mysql" /> <!-- 该参数默认为false --> <!-- 设置为true时,使用RowBounds分页会进行count查询 --> <property name="rowBoundsWithCount" value="true" /> </plugin> <!-- 通用mapper --> <plugin interceptor="com.github.abel533.mapperhelper.MapperInterceptor"> <!--主键自增回写方法,默认值MYSQL,详细说明请看文档 --> <property name="IDENTITY" value="MYSQL" /> <!--通用Mapper接口,多个通用接口用逗号隔开 --> <property name="mappers" value="com.github.abel533.mapper.Mapper" /> </plugin> </plugins> </configuration> ``` applicationContext.xml代码区 ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <plugins> <!-- 分页助手 --> <plugin interceptor="com.github.pagehelper.PageHelper"> <property name="dialect" value="mysql" /> <!-- 该参数默认为false --> <!-- 设置为true时,使用RowBounds分页会进行count查询 --> <property name="rowBoundsWithCount" value="true" /> </plugin> <!-- 通用mapper --> <plugin interceptor="com.github.abel533.mapperhelper.MapperInterceptor"> <!--主键自增回写方法,默认值MYSQL,详细说明请看文档 --> <property name="IDENTITY" value="MYSQL" /> <!--通用Mapper接口,多个通用接口用逗号隔开 --> <property name="mappers" value="com.github.abel533.mapper.Mapper" /> </plugin> </plugins> </configuration> ``` itcast-usermanage-servlet.xml代码区 ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <plugins> <!-- 分页助手 --> <plugin interceptor="com.github.pagehelper.PageHelper"> <property name="dialect" value="mysql" /> <!-- 该参数默认为false --> <!-- 设置为true时,使用RowBounds分页会进行count查询 --> <property name="rowBoundsWithCount" value="true" /> </plugin> <!-- 通用mapper --> <plugin interceptor="com.github.abel533.mapperhelper.MapperInterceptor"> <!--主键自增回写方法,默认值MYSQL,详细说明请看文档 --> <property name="IDENTITY" value="MYSQL" /> <!--通用Mapper接口,多个通用接口用逗号隔开 --> <property name="mappers" value="com.github.abel533.mapper.Mapper" /> </plugin> </plugins> </configuration> ``` web.xml文件 ``` <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>itcast-usermanage</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/applicationContext*.xml</param-value> </context-param> <!--Spring的ApplicationContext 载入 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 编码过滤器,以UTF8编码 --> <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF8</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 解决PUT请求无法提交表单数据的问题 --> <filter> <filter-name>HttpMethodFilter</filter-name> <filter-class>org.springframework.web.filter.HttpPutFormContentFilter</filter-class> </filter> <filter-mapping> <filter-name>HttpMethodFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 将POST请求转化为DELETE或者是PUT 要用_method指定真正的请求方法 --> <filter> <filter-name>HiddenHttpMethodFilter</filter-name> <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class> </filter> <filter-mapping> <filter-name>HiddenHttpMethodFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 配置SpringMVC框架入口 --> <servlet> <servlet-name>itcast-usermanage</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/itcast-usermanage-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>itcast-usermanage</servlet-name> <!-- 可行:/、*.xxx、/xxx/* 不行:/* --> <url-pattern>/rest/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <!-- ________________________________ --> <context-param> <param-name>spring.profiles.active</param-name> <param-value>dev</param-value> </context-param> <context-param> <param-name>spring.profiles.default</param-name> <param-value>dev</param-value> </context-param> <context-param> <param-name>spring.liveBeansView.mbeanDomain</param-name> <param-value>dev</param-value> </context-param> <!-- ________________________________ --> </web-app> ``` 还有的就是,我的tomcat默认是localhost:8080 运行tomcat报错图片 ![图片说明](https://img-ask.csdn.net/upload/201909/12/1568267939_567846.png) 求大佬帮我看看那里出了问题,找了一天了。还是没找到那里有问题!! 一直是400错误! users.jsp代码 ``` <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>会员管理系统</title> <link rel="stylesheet" type="text/css" href="/js/jquery-easyui-1.4/themes/default/easyui.css" /> <link rel="stylesheet" type="text/css" href="/js/jquery-easyui-1.4/themes/icon.css" /> <script type="text/javascript" src="/js/jquery-easyui-1.4/jquery.min.js"></script> <script type="text/javascript" src="/js/jquery-easyui-1.4/jquery.easyui.min.js"></script> <script type="text/javascript" src="/js/jquery-easyui-1.4/locale/easyui-lang-zh_CN.js"></script> <script type="text/javascript" src="/js/common.js"></script> </head> <body> <div> <table class="easyui-datagrid" id="userList" title="会员列表" data-options="singleSelect:false,collapsible:true,pagination:true,url:'/user/list',method:'post',pageSize:5,toolbar:toolbar,pageList:[2,5,10]"> <thead> <tr> <th data-options="field:'ck',checkbox:true"></th> <th data-options="field:'id',width:60">ID</th> <th data-options="field:'userName',width:200">用户名</th> <th data-options="field:'name',width:100">姓名</th> <th data-options="field:'age',width:100">年龄</th> <th data-options="field:'sex',width:80,align:'right',formatter:formatSet">性别</th> <th data-options="field:'birthday',width:80,align:'right',formatter:formatBirthday">出生日期</th> <th data-options="field:'created',width:130,align:'center',formatter:formatDate">创建日期</th> <th data-options="field:'updated',width:130,align:'center',formatter:formatDate">更新日期</th> </tr> </thead> </table> </div> <div id="userAdd" class="easyui-window" title="新增会员" data-options="modal:true,closed:true,iconCls:'icon-save',href:'/user/page/add'" style="width:800px;height:600px;padding:10px;"> The window content. </div> <script type="text/javascript"> function formatDate(val,row){ var now = new Date(val); return now.format("yyyy-MM-dd hh:mm:ss"); } function formatBirthday(val,row){ var now = new Date(val); return now.format("yyyy-MM-dd"); } function formatSet(val,row){ if(val == 1){ return "男"; }else if(val == 2){ return "女"; }else{ return "未知"; } } function getSelectionsIds(){ var userList = $("#userList"); var sels = userList.datagrid("getSelections"); var ids = []; for(var i in sels){ ids.push(sels[i].id); } ids = ids.join(","); return ids; } var toolbar = [{ text:'新增', iconCls:'icon-add', handler:function(){ $('#userAdd').window('open'); } },{ text:'编辑', iconCls:'icon-edit', handler:function(){ $.messager.alert('提示','该功能由学员自己实现!'); } },{ text:'删除', iconCls:'icon-cancel', handler:function(){ var ids = getSelectionsIds(); if(ids.length == 0){ $.messager.alert('提示','未选中用户!'); return ; } $.messager.confirm('确认','确定删除ID为 '+ids+' 的会员吗?',function(r){ if (r){ $.post("/user/delete",{'ids':ids}, function(data){ if(data.status == 200){ $.messager.alert('提示','删除会员成功!',undefined,function(){ $("#userList").datagrid("reload"); }); } }); } }); } },'-',{ text:'导出', iconCls:'icon-remove', handler:function(){ var optins = $("#userList").datagrid("getPager").data("pagination").options; var page = optins.pageNumber; var rows = optins.pageSize; $("<form>").attr({ "action":"/user/export/excel", "method":"POST" }).append("<input type='text' name='page' value='"+page+"'/>") .append("<input type='text' name='rows' value='"+rows+"'/>").submit(); } }]; </script> </body> </html> ``` ![图片说明](https://img-ask.csdn.net/upload/201909/16/1568593584_158545.png)
jdbc实现分页的完整代码该怎么写。
求好心人给完整的代码。让我熟悉一下。 jdbc、servlet、jsp、
MavenWeb项目使用mybatis的分页查询插件,在项目部署时出现错误
MavenWeb项目使用mybatis的分页查询插件,在项目部署时出现错误,在程序中 运行可以查询出来,但是我只要用tomcat启动项目就报错,把mybatis的分页插件 配置注掉后就又可以部署成功,有没有大佬知道是什么情况!?? 下面是报错信息 ``` D:\apache-tomcat-9.0.19\bin\catalina.bat run [2019-06-22 06:33:48,732] Artifact SSM整合:war exploded: Waiting for server connection to start artifact deployment... Using CATALINA_BASE: "C:\Users\95638\.IntelliJIdea2018.3\system\tomcat\Unnamed_SSM整合" Using CATALINA_HOME: "D:\apache-tomcat-9.0.19" Using CATALINA_TMPDIR: "D:\apache-tomcat-9.0.19\temp" Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_144" Using CLASSPATH: "D:\apache-tomcat-9.0.19\bin\bootstrap.jar;D:\apache-tomcat-9.0.19\bin\tomcat-juli.jar" 22-Jun-2019 18:33:49.881 警告 [main] org.apache.tomcat.util.digester.Digester.endElement No rules found matching [Server/Service/Context] 22-Jun-2019 18:33:49.917 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.服务器版本: Apache Tomcat/9.0.19 22-Jun-2019 18:33:49.917 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.构建: Apr 12 2019 14:22:48 UTC 22-Jun-2019 18:33:49.917 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.19.0 22-Jun-2019 18:33:49.917 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10 22-Jun-2019 18:33:49.917 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS.版本: 10.0 22-Jun-2019 18:33:49.917 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 结.造: amd64 22-Jun-2019 18:33:49.917 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java 环境变量: C:\Program Files\Java\jdk1.8.0_144\jre 22-Jun-2019 18:33:49.917 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM 版本: 1.8.0_144-b01 22-Jun-2019 18:33:49.917 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM.供应商: Oracle Corporation 22-Jun-2019 18:33:49.917 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\95638\.IntelliJIdea2018.3\system\tomcat\Unnamed_SSM整合 22-Jun-2019 18:33:49.917 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: D:\apache-tomcat-9.0.19 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\95638\.IntelliJIdea2018.3\system\tomcat\Unnamed_SSM整合\conf\logging.properties 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote= 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs= 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\95638\.IntelliJIdea2018.3\system\tomcat\Unnamed_SSM整合 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=D:\apache-tomcat-9.0.19 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=D:\apache-tomcat-9.0.19\temp 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.21] using APR version [1.6.5]. 22-Jun-2019 18:33:49.918 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 22-Jun-2019 18:33:49.919 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 22-Jun-2019 18:33:49.922 信息 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1a 20 Nov 2018] 22-Jun-2019 18:33:50.039 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["http-nio-8080"] 22-Jun-2019 18:33:50.062 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["ajp-nio-8009"] 22-Jun-2019 18:33:50.066 信息 [main] org.apache.catalina.startup.Catalina.load 服务器在[448]毫秒内初始化 22-Jun-2019 18:33:50.094 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina] 22-Jun-2019 18:33:50.094 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.19] 22-Jun-2019 18:33:50.107 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["http-nio-8080"] 22-Jun-2019 18:33:50.121 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["ajp-nio-8009"] 22-Jun-2019 18:33:50.124 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in [58] milliseconds Connected to server [2019-06-22 06:33:50,289] Artifact SSM整合:war exploded: Artifact is being deployed, please wait... 22-Jun-2019 18:33:52.765 信息 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。 22-Jun-2019 18:33:52.844 信息 [RMI TCP Connection(3)-127.0.0.1] org.springframework.web.context.ContextLoader.initWebApplicationContext Root WebApplicationContext: initialization started 22-Jun-2019 18:33:53.914 信息 [MLog-Init-Reporter] com.mchange.v2.log.MLog. MLog clients using java 1.4+ standard logging. 22-Jun-2019 18:33:53.996 信息 [RMI TCP Connection(3)-127.0.0.1] com.mchange.v2.c3p0.C3P0Registry. Initializing c3p0-0.9.5.4 [built 23-March-2019 23:00:48 -0700; debug? true; trace: 10] 22-Jun-2019 18:33:54.097 警告 [RMI TCP Connection(3)-127.0.0.1] org.springframework.context.support.AbstractApplicationContext.refresh Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'departmentService': Unsatisfied dependency expressed through field 'departmentMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'departmentMapper' defined in file [E:\SSM整合\out\artifacts\SSM_war_exploded\WEB-INF\classes\com\neuedu\dao\DepartmentMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring.xml]: Cannot create inner bean 'com.github.pagehelper.PageInterceptor#360582c8' of type [com.github.pagehelper.PageInterceptor] while setting bean property 'plugins' with key [0]; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.github.pagehelper.PageInterceptor] for bean with name 'com.github.pagehelper.PageInterceptor#360582c8' defined in class path resource [spring.xml]; nested exception is java.lang.ClassNotFoundException: com.github.pagehelper.PageInterceptor 22-Jun-2019 18:33:54.103 严重 [RMI TCP Connection(3)-127.0.0.1] org.springframework.web.context.ContextLoader.initWebApplicationContext Context initialization failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'departmentService': Unsatisfied dependency expressed through field 'departmentMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'departmentMapper' defined in file [E:\SSM整合\out\artifacts\SSM_war_exploded\WEB-INF\classes\com\neuedu\dao\DepartmentMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring.xml]: Cannot create inner bean 'com.github.pagehelper.PageInterceptor#360582c8' of type [com.github.pagehelper.PageInterceptor] while setting bean property 'plugins' with key [0]; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.github.pagehelper.PageInterceptor] for bean with name 'com.github.pagehelper.PageInterceptor#360582c8' defined in class path resource [spring.xml]; nested exception is java.lang.ClassNotFoundException: com.github.pagehelper.PageInterceptor at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4682) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5150) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:713) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:695) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1728) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:457) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:406) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'departmentMapper' defined in file [E:\SSM整合\out\artifacts\SSM_war_exploded\WEB-INF\classes\com\neuedu\dao\DepartmentMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring.xml]: Cannot create inner bean 'com.github.pagehelper.PageInterceptor#360582c8' of type [com.github.pagehelper.PageInterceptor] while setting bean property 'plugins' with key [0]; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.github.pagehelper.PageInterceptor] for bean with name 'com.github.pagehelper.PageInterceptor#360582c8' defined in class path resource [spring.xml]; nested exception is java.lang.ClassNotFoundException: com.github.pagehelper.PageInterceptor at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:314) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1681) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1433) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1251) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1171) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593) ... 60 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring.xml]: Cannot create inner bean 'com.github.pagehelper.PageInterceptor#360582c8' of type [com.github.pagehelper.PageInterceptor] while setting bean property 'plugins' with key [0]; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.github.pagehelper.PageInterceptor] for bean with name 'com.github.pagehelper.PageInterceptor#360582c8' defined in class path resource [spring.xml]; nested exception is java.lang.ClassNotFoundException: com.github.pagehelper.PageInterceptor at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:361) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedArray(BeanDefinitionValueResolver.java:388) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:155) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1681) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1433) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303) ... 73 more Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.github.pagehelper.PageInterceptor] for bean with name 'com.github.pagehelper.PageInterceptor#360582c8' defined in class path resource [spring.xml]; nested exception is java.lang.ClassNotFoundException: com.github.pagehelper.PageInterceptor at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1392) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:487) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:346) ... 85 more Caused by: java.lang.ClassNotFoundException: com.github.pagehelper.PageInterceptor at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1363) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1186) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.springframework.util.ClassUtils.forName(ClassUtils.java:275) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:444) at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1457) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1384) ... 87 more 22-Jun-2019 18:33:54.140 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file 22-Jun-2019 18:33:54.142 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors [2019-06-22 06:33:54,184] Artifact SSM整合:war exploded: Error during artifact deployment. See server log for details. 22-Jun-2019 18:34:00.118 信息 [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory 把web 应用程序部署到目录 [D:\apache-tomcat-9.0.19\webapps\manager] 22-Jun-2019 18:34:00.415 信息 [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\apache-tomcat-9.0.19\webapps\manager] has finished in [297] ms ``` # springmvc.xml的配置 ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd"> <context:component-scan base-package="com.neuedu" use-default-filters="false"> <!--指定指挥扫描那些类型的注解,这里指定只会扫描com.neuedu下或子包中的注解@Controller。其他注解不扫描--> <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/> </context:component-scan> <!--导入依赖注入的注解解析器 --> <context:annotation-config></context:annotation-config> <!--开启基于注解的处理器映射器与处理器适配器 --> <mvc:annotation-driven ></mvc:annotation-driven> <!--配置吧静态资源交给tomcat来处理(springmvc框架就不要处理了) --> <mvc:default-servlet-handler></mvc:default-servlet-handler> <!-- 视图解析器 解析jsp解析,默认使用jstl标签,classpath下的得有jstl的包 --> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <!-- 配置jsp路径的前缀 --> <property name="prefix" value="/WEB-INF/jsp/"/> <!-- 配置jsp路径的后缀 --> <property name="suffix" value=".jsp"/> </bean> </beans> ``` # spring.xml的配置 ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/cache" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd"> <!--配置对service及dao包的扫描 --> <context:component-scan base-package="com.neuedu"> <!--配置对那些注解不进行扫描(不扫描注解@controller,因为他被springmvc扫描了) --> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/> </context:component-scan> <!--配置开启依赖注入的注解解析器(主要针对@Autoired,@Resource注解) --> <context:annotation-config/> <!--配置通过引入配置文件来进行数据库连接 --> <context:property-placeholder location="classpath:jdbc"/> <!--配置基于c3p0的数据库连接池,该类在c3p0对应的jar包中 --> <bean id="c3p0DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <!--配置数据库连接的基本属性 --> <property name="driverClass" value="${jdbc.driverClass}"/> <property name="jdbcUrl" value="${jdbc.dburl}"/> <property name="user" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> </bean> <!--配置sqlSessionFactory 该类在Mybatis-spring jar包中--> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <!--通过整合mybatis框架的核心配置文件,通过属性configLocation来指定 --> <property name="configLocation" value="classpath:mybatis-config.xml"/> <!--配置引用数据源(数据库连接池) --> <property name="dataSource" ref="c3p0DataSource"/> <!--配置加载那些mybatis框架中的映射文件 --> <property name="mapperLocations" value="classpath:mapper/*.xml"/> <!-- 在 Spring 配置文件中配置拦截器插件 --> <property name="typeAliasesPackage" value="com.isea533.mybatis.model"/> <property name="plugins"> <array> <bean class="com.github.pagehelper.PageInterceptor"> <!-- 这里的几个配置主要演示如何使用,如果不理解,一定要去掉下面的配置 --> <property name="properties"> <value> helperDialect=mysql reasonable=true supportMethodsArguments=true params=count=countSql autoRuntimeDialect=true </value> </property> </bean> </array> </property> </bean> <!--配置事务管理器类,该类在Spring-jdbc jar包中 --> <bean id="tx" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <!--关联数据源 --> <property name="dataSource" ref="c3p0DataSource"/> </bean> <!--配置开启基于注解的事务管理的注解解析器(@Transactional) --> <!--<tx:annotation-driven transaction-manager="tx"/>--> <!--配置dao曾家口的实现代理 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <!--配置对那个包进行接口扫描 --> <property name="basePackage" value="com.neuedu.dao"/> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/> </bean> </beans> ``` # mybatis.xml的配置 ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <settings> <setting name="mapUnderscoreToCamelCase" value="true"/> </settings> </configuration> ``` 来个大佬捞一手叭!
jsp分页问题,,,,,,,,,,,,,,,
求大神看看   显示列表只有第一页有全部信息,但是页码、上一页、下一页  都有  就是没有内容分页数目正确  但是内容全显示在第一页 package org.pan.web; import java.sql.*; import java.util.Vector; import org.pan.util.*; import javax.servlet.http.HttpServletRequest; import org.pan.web.book.shopuser; public > private shopuser user = new shopuser(); //新的用户对象 private javax.servlet.http.HttpServletRequest request; //建立页面请求 private Vector userlist; //显示用户列表向量数组 private int page = 1; //显示的页码 private int pageSize=3; //每页显示的图书数 private int pageCount =0; //页面总数 private long recordCount =0; //查询的记录总数 private String message = ""; //出错信息提示 private String username = ""; //注册后返回的用户名 private long userid = 0; //注册后返回的用户ID public usermn() throws Exception{ super(); } public Vector getUserlist() { return userlist; } public String getGbk( String str) { try { return new String(str.getBytes("ISO8859-1")); } catch (Exception e) { return str; } } //将页面表单传来的资料分解 public boolean getRequest(javax.servlet.http.HttpServletRequest newrequest) { boolean flag = false; try { request = newrequest; String ID = request.getParameter("userid"); if (ID!=null ) { userid = 0; try { userid = Long.parseLong(ID); user.setId(userid); } catch (Exception e) { message = message + "你要修改的用户号出错!"; } } username = request.getParameter("username"); if (username==null || username.equals("")) { username = ""; message = message + "用户名为空!"; } user.setUserName(getGbk(username));  String password = request.getParameter("passwd"); if (password==null || password.equals("")) { password = ""; message = message + "密码为空!"; } String pwdconfirm = request.getParameter("passconfirm"); if (!password.equals(pwdconfirm)) { message = message + "确认密码不相同!"; } user.setPassWord(getGbk(password)); String names = request.getParameter("names");; if (names==null) { names = ""; } user.setNames(getGbk(names)); String sex = request.getParameter("sex"); user.setSex(getGbk(sex)); String address = request.getParameter("address"); if (address == null) { address = ""; } user.setAddress(getGbk(address)); String post = request.getParameter("post"); if (post == null) { post = ""; } user.setPost(getGbk(post)); String phone = request.getParameter("phone"); if (phone== null) { phone = ""; } user.setPhone(phone); String email = request.getParameter("email"); if (email == null) { email = ""; } user.setEmail(getGbk(email)); String IP = request.getRemoteAddr(); user.setRegIpAddress(IP); if (message.equals("")) { flag = true; } return flag; } catch (Exception e) { return flag; } } public String getSql() { sqlStr = "select * from my_users order by id"; return sqlStr; } public boolean execute() throws Exception { sqlStr = "select count(*) from my_users";    //取出记录数 int rscount = pageSize; try { ResultSet rs1 = stmt.executeQuery(sqlStr); if (rs1.next()) recordCount = rs1.getInt(1); rs1.close(); } catch (SQLException e) { close(); return false; } //设定有多少pageCount if (recordCount < 1)             pageCount = 0;         else             pageCount = (int)(recordCount - 1) / pageSize + 1; //检查查看的页面数是否在范围内 if (page < 1)               page = 1;         else if (page > pageCount)             page = pageCount; rscount = (int) recordCount % pageSize;  // 最后一页记录数         //sql为倒序取值 sqlStr = "select * from My_users "; if (page == 1) { sqlStr = sqlStr + " order by Id desc"; } else { sqlStr = sqlStr + " where Id not in ( select Id from My_users ORDER BY id) and Id in " + "(select Id from My_users ORDER BY ID) " + " order by Id desc"; } try { rs = stmt.executeQuery(sqlStr); userlist = new Vector(); while (rs.next()){ shopuser user = new shopuser(); user.setId(rs.getLong("Id")); user.setUserName(rs.getString("UserName")); user.setPassWord(rs.getString("PassWord")); user.setNames(rs.getString("Names")); user.setSex(rs.getString("Sex")); user.setAddress(rs.getString("Address")); user.setPhone(rs.getString("Phone")); user.setPost(rs.getString("Post")); user.setEmail(rs.getString("Email")); user.setRegTime(rs.getString("RegTime")); user.setRegIpAddress(rs.getString("RegIpAddress")); userlist.addElement(user); } rs.close(); return true; } catch (SQLException e) { System.out.println(e); return false; } } public boolean insert(HttpServletRequest req) throws Exception { if (getRequest(req)) { sqlStr = "select * from My_users where username = '" + user.getUserName() +"'"; rs = stmt.executeQuery(sqlStr); if (rs.next()) { message = message + "该用户名已存在!"; rs.close(); return false; } sqlStr = "insert into my_users (username,password,Names,sex,Address,Phone,Post,Email,RegTime,RegIpaddress) values ('"; sqlStr = sqlStr + strFormat.toSql(user.getUserName()) + "','"; sqlStr = sqlStr + strFormat.toSql(user.getPassWord()) + "','"; sqlStr = sqlStr + strFormat.toSql(user.getNames()) + "','"; sqlStr = sqlStr + strFormat.toSql(user.getSex()) + "','"; sqlStr = sqlStr + strFormat.toSql(user.getAddress()) + "','"; sqlStr = sqlStr + strFormat.toSql(user.getPhone()) + "','"; sqlStr = sqlStr + strFormat.toSql(user.getPost()) + "','"; sqlStr = sqlStr + strFormat.toSql(user.getEmail()) + "',now(),'"; sqlStr = sqlStr + user.getRegIpAddress() + "')"; try { stmt.execute(sqlStr); sqlStr = "select max(id) from My_users where username = '" +user.getUserName()+ "'"; rs = stmt.executeQuery(sqlStr); while (rs.next()) { userid = rs.getLong(1); } rs.close(); return true; } catch (SQLException sqle) { return false; } } else { return false; } } public boolean update(HttpServletRequest req) throws Exception { if (getRequest(req)){ sqlStr = "update my_users set "; sqlStr = sqlStr + "username = '" + strFormat.toSql(user.getUserName()) + "',"; sqlStr = sqlStr + "password = '" + strFormat.toSql(user.getPassWord()) + "',"; sqlStr = sqlStr + "Names = '" + strFormat.toSql(user.getNames()) + "',"; sqlStr = sqlStr + "sex = '" + strFormat.toSql(user.getSex()) + "',"; sqlStr = sqlStr + "address = '" + strFormat.toSql(user.getAddress()) + "',"; sqlStr = sqlStr + "phone = '" + strFormat.toSql(user.getPhone()) + "',"; sqlStr = sqlStr + "post = '" + strFormat.toSql(user.getPost()) + "',"; sqlStr = sqlStr + "Email = '" + strFormat.toSql(user.getEmail()) + "' "; sqlStr = sqlStr + " where id = '" + user.getId() + "'"; try { stmt.execute(sqlStr); return true; } catch (SQLException e) { return false; } } else { return false; } } public boolean delete( long aid ) throws Exception { sqlStr = "delete from My_users where id = "  + aid ; try { stmt.execute(sqlStr); return true; } catch (SQLException e) { System.out.println(e); return false; } } public boolean getUserinfo(long newid ) throws Exception { try { sqlStr="select  * from My_users where Id = " + newid ; rs = stmt.executeQuery(sqlStr); userlist = new Vector(); while (rs.next()){ user.setId(rs.getLong("Id")); user.setUserName(rs.getString("UserName")); user.setPassWord(rs.getString("PassWord")); user.setNames(rs.getString("Names")); user.setSex(rs.getString("Sex")); user.setAddress(rs.getString("Address")); user.setPhone(rs.getString("Phone")); user.setPost(rs.getString("Post")); user.setEmail(rs.getString("Email")); user.setRegTime(rs.getString("RegTime")); user.setRegIpAddress(rs.getString("RegIpAddress")); userlist.addElement(user); } rs.close(); return true; } catch (SQLException e) { return false; } } public int getPage() { //显示的页码 return page; } public void setPage(int newpage) { page = newpage; } public int getPageSize(){ //每页显示的图书数 return pageSize; } public void setPageSize(int newpsize) { pageSize = newpsize; } public int getPageCount() { //页面总数 return pageCount; } public void setPageCount(int newpcount) { pageCount = newpcount; } public long getRecordCount() { return recordCount; } public void setRecordCount(long newrcount) { recordCount= newrcount; } public String getMessage() { return message; } public void setMessage(String msg) { message = msg; } public void setUserid(long uid) { userid = uid; } public long getUserid() { return userid; } public void setUserName(String uName) { username = uName; } public String getUserName() { return username; } };
用MyEclipse分布查询在网页上没有运行成功,新手求指点
新手,用MyEclipse写了个分页查询,在网页打开后没有显示成功,报错了,看不懂哪里错了,求给小弟指点下。符上出错报告,这是网页上显示的 type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: An exception occurred processing JSP page /listEmp.jsp at line 36 33: <th>閭</th> 34: <th>钖按</th> 35: </tr> 36: <c:forEach items="${pageBean.data}" var="emp"> 37: <tr> 38: <td>${emp.id }</td> 39: <td>${emp.name }</td> Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) gz.itcast.web.ListEmpServlet.doGet(ListEmpServlet.java:55) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause org.apache.jasper.el.JspPropertyNotFoundException: /listEmp.jsp(36,5) '${pageBean.data}' Property 'data' not found on type gz.itcast.entity.pageBean org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:104) org.apache.jsp.listEmp_jsp._jspx_meth_c_005fforEach_005f0(listEmp_jsp.java:148) org.apache.jsp.listEmp_jsp._jspService(listEmp_jsp.java:97) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) gz.itcast.web.ListEmpServlet.doGet(ListEmpServlet.java:55) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs. Apache Tomcat/6.0.13
关于购物商城左侧的分类导航菜单,求教授下!!!!
我现在正在做一个项目,servlet+jsp+ajax来实现类似亚马逊商城的购物网站,但是在主页的左侧商品分类那里没有找到写的思路,网上查找方法也全是用jquery来完成的,我想问下有哪位大佬写过使用servlet+jsp+ajax来实现商城左侧分类分页功能的博客之类的吗?有的话求发网址!!!!!
(Java WEB)http-404,新手卡着好几天了。
最近改写别人的Java Web项目练习,遇到这个问题卡着两三天了。 ![图片说明](https://img-ask.csdn.net/upload/201705/10/1494384669_341338.png) 以下是JSP代码 ``` <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>left</title> <base target="body"/> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> <script type="text/javascript" src="<c:url value='/jquery/jquery-1.5.1.js'/>"></script> <script type="text/javascript" src="<c:url value='/menu/mymenu.js'/>"></script> <link rel="stylesheet" href="<c:url value='/menu/mymenu.css'/>" type="text/css" media="all"> <link rel="stylesheet" type="text/css" href="<c:url value='/jsps/css/left.css'/>"> <script language="javascript"> /* * 1. 对象名必须与第一个参数相同! 2. 第二个参数是显示在菜单上的大标题 */ var bar = new Q6MenuBar("bar", "仙林大学城网上书城"); $(function() { bar.colorStyle = 4;//指定配色样式,一共0,1,2,3,4 bar.config.imgDir = "<c:url value='/menu/img/'/>";//小工具所需图片的路径 bar.config.radioButton=true;//是否排斥,多个一级分类是否排斥 /* 1. 程序设计:一级分类名称 2. Java Javascript:二级分类名称 3. /goods/jsps/book/list.jsp:点击二级分类后链接到的URL 4. body:链接的内容在哪个框架页中显示 */ <c:forEach items="${parents}" var="parent"> <c:forEach items="${parent.children}" var="child"> bar.add("${parent.cname}", "${child.cname}", "/goods/BookServlet?method=findByCategory&cid=${child.cid}", "body"); </c:forEach> </c:forEach> $("#menu").html(bar.toString()); }); </script> </head> <body> <div id="menu"></div> </body> </html> ``` 以下servlet代码 ``` package cn.itcast.goods.book.web.servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import cn.itcast.commons.CommonUtils; import cn.itcast.goods.book.domain.Book; import cn.itcast.goods.book.service.BookService; import cn.itcast.goods.pager.PageBean; import cn.itcast.servlet.BaseServlet; public class BookServlet extends BaseServlet { private BookService bookService = new BookService(); /** * 获取当前页码 * * @param req * @return */ private int getPc(HttpServletRequest req) { int pc = 1; String param = req.getParameter("pc"); if (param != null && !param.trim().isEmpty()) { try { pc = Integer.parseInt(param); } catch (RuntimeException e) { } } return pc; } /** * 截取url,页面中的分页导航中需要使用它做为超链接的目标! * * @param req * @return */ /* * http://localhost:8080/goods/BookServlet?methed=findByCategory&cid=xxx&pc=3 * /goods/BookServlet + methed=findByCategory&cid=xxx&pc=3 */ private String getUrl(HttpServletRequest req) { String url = req.getRequestURI() + "?" + req.getQueryString(); /* * 如果url中存在pc参数,截取掉,如果不存在那就不用截取。 */ int index = url.lastIndexOf("&pc="); if (index != -1) { url = url.substring(0, index); } return url; } /** * 按bid查询 * * @param req * @param resp * @return * @throws ServletException * @throws IOException */ public String load(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String bid = req.getParameter("bid");//获取链接的参数bid Book book = bookService.load(bid);//通过bid得到book对象 req.setAttribute("book", book);//保存到req中 return "f:/jsps/book/desc.jsp";//转发到desc.jsp } /** * 按分类查 * * @param req * @param resp * @return * @throws ServletException * @throws IOException */ public String findByCategory(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { /* * 1. 得到pc:如果页面传递,使用页面的,如果没传,pc=1 */ int pc = getPc(req); /* * 2. 得到url:... */ String url = getUrl(req); /* * 3. 获取查询条件,本方法就是cid,即分类的id */ String cid = req.getParameter("cid"); /* * 4. 使用pc和cid调用service#findByCategory得到PageBean */ PageBean<Book> pb = bookService.findByCategory(cid, pc); /* * 5. 给PageBean设置url,保存PageBean,转发到/jsps/book/list.jsp */ pb.setUrl(url); req.setAttribute("pb", pb); return "f:/jsps/book/list.jsp"; } /** * 按作者查 * * @param req * @param resp * @return * @throws ServletException * @throws IOException */ public String findByAuthor(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { /* * 1. 得到pc:如果页面传递,使用页面的,如果没传,pc=1 */ int pc = getPc(req); /* * 2. 得到url:... */ String url = getUrl(req); /* * 3. 获取查询条件,本方法就是cid,即分类的id */ String author = req.getParameter("author"); /* * 4. 使用pc和cid调用service#findByCategory得到PageBean */ PageBean<Book> pb = bookService.findByAuthor(author, pc); /* * 5. 给PageBean设置url,保存PageBean,转发到/jsps/book/list.jsp */ pb.setUrl(url); req.setAttribute("pb", pb); return "f:/jsps/book/list.jsp"; } /** * 按出版社查询 * * @param req * @param resp * @return * @throws ServletException * @throws IOException */ public String findByPress(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { /* * 1. 得到pc:如果页面传递,使用页面的,如果没传,pc=1 */ int pc = getPc(req); /* * 2. 得到url:... */ String url = getUrl(req); /* * 3. 获取查询条件,本方法就是cid,即分类的id */ String press = req.getParameter("press"); /* * 4. 使用pc和cid调用service#findByCategory得到PageBean */ PageBean<Book> pb = bookService.findByPress(press, pc); /* * 5. 给PageBean设置url,保存PageBean,转发到/jsps/book/list.jsp */ pb.setUrl(url); req.setAttribute("pb", pb); return "f:/jsps/book/list.jsp"; } /** * 按图名查 * * @param req * @param resp * @return * @throws ServletException * @throws IOException */ public String findByBname(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { /* * 1. 得到pc:如果页面传递,使用页面的,如果没传,pc=1 */ int pc = getPc(req); /* * 2. 得到url:... */ String url = getUrl(req); /* * 3. 获取查询条件,本方法就是cid,即分类的id */ String bname = req.getParameter("bname"); /* * 4. 使用pc和cid调用service#findByCategory得到PageBean */ PageBean<Book> pb = bookService.findByBname(bname, pc); /* * 5. 给PageBean设置url,保存PageBean,转发到/jsps/book/list.jsp */ pb.setUrl(url); req.setAttribute("pb", pb); return "f:/jsps/book/list.jsp"; } /** * 多条件组合查询 * @param req * @param resp * @return * @throws ServletException * @throws IOException */ public String findByCombination(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { /* * 1. 得到pc:如果页面传递,使用页面的,如果没传,pc=1 */ int pc = getPc(req); /* * 2. 得到url:... */ String url = getUrl(req); /* * 3. 获取查询条件,本方法就是cid,即分类的id */ Book criteria = CommonUtils.toBean(req.getParameterMap(), Book.class); PageBean<Book> pb = bookService.findByCombination(criteria, pc); /* * 4. 使用pc和cid调用service#findByCategory得到PageBean */ /* * 5. 给PageBean设置url,保存PageBean,转发到/jsps/book/list.jsp */ pb.setUrl(url); req.setAttribute("pb", pb); return "f:/jsps/book/list.jsp"; } } ``` 以下是web.xml相关配置 ``` <servlet> <servlet-name>BookServlet</servlet-name> <servlet-class>cn.itcast.goods.book.web.servlet.BookServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>BookServlet</servlet-name> <url-pattern>/BookServlet</url-pattern> </servlet-mapping> ``` 相关文件位置 ![图片说明](https://img-ask.csdn.net/upload/201705/10/1494385059_583764.png)
求各位大神不吝源代码呀
程序要求: 1. 项目名称:基于JSP的公告系统 2. 功能说明: 1) 提供基于数据库的用户认证:只有正确的登录后才发布,编辑,删除公告; 2) 提供用户注册页面,可以注册新的用户; 3) 登录后可以对通过web页面对公告的增、删、查(按公告的ID)、改,公告存储必须包含ID、标题、内容、发布时间、发布人五个字段; 3. 技术要求: 1) 运行环境jdk8+tomcat8+mysql5 2) 开发技术:JSP +Servlet +JavaBean(可使用开源框架) 评分标准: 1. 基本功能60分: 1) 用户认证:10分 2) 用户注册:10分 3) 公告增删查改:40分 2. 界面开发20分 1) 使用CSS技术:10分 2) 使用JavaScript技术:10分 3. 附加分20分,加分项 1) 使用MVC框架 2) 增加新的功能,如支持图片内容、文件上传、公告删除回收站、分页显示、权限过滤(登陆验证)、登录验证码、公告发布审核、MD5加密等。
extj 分页不成功,现在数据只能取start,limit设定的数据,分页无效
JS: ``` var page_size=5; var start_size=0; Ext.onReady(function() { var store = new Ext.data.JsonStore({ proxy:new Ext.data.HttpProxy({url:'json.jsp'}), // autoLoad: true, totalProperty: 'totalCount', root:'root', fields : [{ name : 'CJ' }, { name : 'CQLG_TJSJ' }, { name : 'KCDM' }, { name : 'KCMC' }, { name : 'OPERATE_TIME' }, { name : 'XH' }, { name : 'XKKH' }, { name : 'XM' }, { name : 'XN' }, { name : 'XQ' }, { name : '事件类型' }, { name : '操作用户' }, { name : '数据库对象' }, { name : '数据库对象类型' }, { name : '数据类型' }] }); //分页工具 var pagingToolbar = new Ext.PagingToolbar({ pageSize: page_size, store: store, displayInfo: true, displayMsg: "显示第 {0} 条到 {1} 条记录 ,一共 {2} 条", emptyMsg: "没有记录", }); var grid = new Ext.grid.GridPanel({ store : store, columns : [{ header : '成绩', dataIndex : 'CJ', align : 'center', flex : 4.1 }, { header : '提交时间', dataIndex : 'CQLG_TJSJ', align : 'center', flex : 7.6867 }, { header : '课程代码', dataIndex : 'KCDM', align : 'center', flex : 5.1245 }, { header : '课程名称', dataIndex : 'KCMC', align : 'center', flex : 11.9327 }, { header : '操作时间', dataIndex : 'OPERATE_TIME', align : 'center', flex : 10.2489 } , { header : '学号', dataIndex : 'XH', align : 'center', flex : 6.8814 } , { header : '选课课号', dataIndex : 'XKKH', align : 'center', flex : 7.0278 } , { header : '姓名', dataIndex : 'XM', align : 'center', flex : 4.3924 } , { header : '学年', dataIndex : 'XN', align : 'center', flex : 5.7101 } , { header : '学期', dataIndex : 'XQ', align : 'center', flex : 3.6603 } , { header : '事件类型', dataIndex : '事件类型', align : 'center', flex : 5.1245 } , { header : '操作用户', dataIndex : '操作用户', align : 'center', flex : 5.3441 } , { header : '数据库对象', dataIndex : '数据库对象', align : 'center', flex : 6.1493 } , { header : '数据库对象类型', dataIndex : '数据库对象类型', align : 'center', flex : 8.1742 }, { header : '数据类型', dataIndex : '数据类型', align : 'center', flex : 7.1742 }], stripeRows : true, autoExpandColumn : 'name', height : 700, width : 1428, title : '异动详情', stateful : true, stateId : 'grid', tbar :pagingToolbar }); store.load({params:{start:start_size,limit:page_size}}); var win = new Ext.Window({ layout : 'fit', flex : 100, draggable:false, height : 600, // title : ' 学生成绩监控系统', items : [grid], // buttons : [{ // text : '刷新', // handler : function() { // store.load({params:{start:start_size,limit:page_size}}); // } // }] }); win.setPosition(0,142);//设置窗口绝对位置 win.show(); }); ``` java: ``` package jsonEngine; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.json.JSONArray; public class cjb_show_info { public String dataStr;//csi()赋值 public int i; public int totalCount; public static void main(String args[]){ // cjb_show_info t = new cjb_show_info();//调用,仅供测试 // t.csi(); // System.out.println("__________________________________________"); // System.out.println(t.dataStr);//数据前后对比 } // public void Buffer(String str1,String str2,int c){ // StringBuffer Buffer= new StringBuffer(str1); // Buffer.insert(c, str2); // dataStr=Buffer.toString(); // } public String csi(int start,int limit){ cjb_show cjb_sh; // 连接数据库 String sql_1 = "select * from cjb_show"; ArrayList<cjb_show> list = new ArrayList<cjb_show>(); ArrayList<cjb_show> temp = new ArrayList<cjb_show>(); String url = "jdbc:oracle:thin:@localhost:1521:orcl";//配置连接池 list.clear(); try{ Class.forName("oracle.jdbc.driver.OracleDriver"); Connection connection = DriverManager.getConnection(url, "yunhua", "yunhua"); Statement stmt = connection.createStatement();// 连接数据库 ResultSet rs_1 = stmt.executeQuery(sql_1); while (rs_1.next()) { String CJ = rs_1.getString("CJ"); String 数据类型 = rs_1.getString("数据类型"); String XN = rs_1.getString("XN"); String XQ = rs_1.getString("XQ"); String XKKH = rs_1.getString("XKKH"); String XH = rs_1.getString("XH"); String XM = rs_1.getString("XM"); String KCMC = rs_1.getString("KCMC"); String KCDM = rs_1.getString("KCDM"); String CQLG_TJSJ = rs_1.getString("CQLG_TJSJ"); String OPERATE_TIME = rs_1.getString("OPERATE_TIME"); String 操作用户 = rs_1.getString("操作用户"); String 事件类型 = rs_1.getString("事件类型"); String 数据库对象类型 = rs_1.getString("数据库对象类型"); String 数据库对象 = rs_1.getString("数据库对象"); String 客户端IP = rs_1.getString("客户端IP"); //通过调用构造将数据写入cjb_sh对象中 cjb_sh = new cjb_show(数据类型,CJ,XN, XQ, XKKH, XH, XM, KCMC, KCDM, CQLG_TJSJ, OPERATE_TIME, 操作用户, 事件类型, 数据库对象类型, 数据库对象, 客户端IP); //将对象加入到列表中 list.add(cjb_sh); }//while结束 totalCount = list.size(); //以下代码仅供翻页使用, for(int i=0;i<list.size();i++){ if(start<=i&i<limit){ cjb_show cjb_sh1 = list.get(i); temp.add(cjb_sh1); } } // String str1="{\"totalCount\":"+"\""+totalCount+"\""+",\"root\":"; // String str2="}"; System.out.println("数量:"+totalCount);//打印记录数量 JSONArray jsonarray = JSONArray.fromObject(temp);//将字符串转换为json格式 dataStr = jsonarray.toString();//---------给字符串赋值--------- // Buffer(dataStr,str1,1); // str1+=dataStr; // str1+=str2; // dataStr = str1; System.out.println(dataStr); list.clear(); rs_1.close ( ); stmt.close ( ); connection.close ( ); } catch(Exception e){ return " "; } return null;//方法csi()结束 } } ``` 现在自己分析,记录数取得不对,谢谢各位!
求大神帮我做一个真分页 通过后台查询的那种 在线急等 希望能有些注释 不然我也看不懂
麻烦哪位大神帮我弄的分页 下面我会贴出我的代码,我用的是Hibernate+spring+jsp 用maven写的 如果大神有工具类就帮我整合下吧 十分感谢 在线急等 dao层实现 ``` /* * @(#) usersDaoImpl.java 2015年12月9日 * * Copyright (c) 2015,RongHui Technology. All Rights Reserved. * WWW.RHTECH.NET CONFIDENTIAL */ package com.ronghui.dao; import java.util.List; import javax.annotation.Resource; import javax.transaction.Transactional; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.stereotype.Repository; import com.ronghui.model.User; @Repository("usersDao") public class usersDaoImpl implements usersDao { // extends BaseDaoImpl<UserEntity, Integer> @Resource protected SessionFactory sessionFactory; public Session getSession() { return sessionFactory.getCurrentSession(); } public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } //用户是否存在 @Override public boolean isExist(User user) { Session session = this.getSession(); String hql = "from User where name =? and pwd = ?"; Query query = session.createQuery(hql); query.setString(0, user.getName()); query.setString(1, user.getPwd()); if (query.list().size() >= 1) { return true; } return false; } //显示 @Override public List<User> listInfo() { // TODO Auto-generated method stub String hql="from User"; Query query=(Query)this.getSession().createQuery(hql); List<User> list=query.list(); return list; } //模糊查询 @Override public List<User> vagueInfo(String name) { // TODO Auto-generated method stub String hql ="from User e where e.name like '%"+name+"%'"; Query query =getSession().createQuery(hql); List<User> vaguelist =query.list(); return vaguelist; } } } ``` service ``` /* * @(#) usersServiceImpl.java 2015年12月9日 * * Copyright (c) 2015,RongHui Technology. All Rights Reserved. * WWW.RHTECH.NET CONFIDENTIAL */ package com.ronghui.service; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.ronghui.dao.usersDao; import com.ronghui.model.User; @Transactional @Service("usersService") public class usersServiceImpl implements usersService { @Resource private usersDao usersDao; @Override public boolean isExist(User user) { // TODO Auto-generated method stub return usersDao.isExist(user); } @Override public List<User> listInfo() { // TODO Auto-generated method stub return usersDao.listInfo(); } @Override public void delete(int id) { // TODO Auto-generated method stub usersDao.delete(id); } @Override public User listId(int id) { // TODO Auto-generated method stub return usersDao.listId(id); } @Override public List<User> vagueInfo(String name) { // TODO Auto-generated method stub return usersDao.vagueInfo(name); } } ``` controller ``` /** * */ package com.ronghui.controller; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.ronghui.model.User; import com.ronghui.service.usersService; @Controller public class UserController { @Autowired private usersService usersService; private String name; @ResponseBody @RequestMapping(value = "/user/login", method = RequestMethod.POST) public Map<String, Object> login(User user) { Map<String, Object> map = new HashMap<String, Object>(); boolean loginResult = usersService.isExist(user); map.put("loginResult", loginResult); return map; } //测试 @RequestMapping(value = "/test", method = RequestMethod.GET) public String getupdate() { return "test"; } @RequestMapping(value = "/content", method = RequestMethod.GET) public String getcontent() { return "content"; } @RequestMapping(value = "/add", method = RequestMethod.GET) public String getadd() { return "addUser"; } // list显示 @RequestMapping(value = "/mian", method = RequestMethod.GET) public String userlogin(ModelMap model) { List list = usersService.listInfo(); model.addAttribute("list", list); return "mian"; } //模糊查询 @RequestMapping("vague") public String vague(String name,ModelMap model){ List list=usersService.vagueInfo(name); model.addAttribute("list", list); return "mian"; } } ``` jsp ``` <body id="7" style="background-image: url('static/images/bj3.jpg');"> <div id="st-container" class="st-container"> <!-- content push wrapper --> <div class="st-pusher" id="5"> <div class="st-content" id="4"> <!-- this is the wrapper for the content --> <div class="st-content-inner" id="3"> <header class="codrops-header"> <h1 style="color: #48a770"> ChenHonest Administrate <span>User information management case</span> </h1> </header> <div class="main clearfix" id="2"> <div id="st-trigger-effects" class="column" style="padding-left: 0px; padding-right: 18px;"> <form action="vague" method="post"> <div class="form-group"> <div class="field"> <div class="input-group"> <span class="addbtn"> <button type="button" class="button bg-green-light icon-search"></button> </span> <input id="vague" type="text" class="input" name="name" size="50" placeholder="用户名关键词" /><span class="addbtn"> <button type="submit" class="button bg-green-light">搜索</button> </span> </div> </div> </div> </form> <br> <table class="table table-hover" style="line-height: 35px; color: #48a770;"> <tr> <th width="400">用户名</th> <th width="600">昵称</th> <th width="200">年龄</th> <th width="1000">操作</th> </tr> <c:if test="${empty list}"> <tr style="height: 340px;"> <td align="center" colspan=4><h3>未找到内容</h3></td> </tr> </c:if> <c:forEach var="item" items="${list}"> <tr id="content"> <th width="400"><a href="con?id=${item.id}">${item.name }</a></th> <th width="600"><a href="upd?id=${item.id}">${item.nice_name }</a></th> <th width="200"><a href="upd?id=${item.id}">${item.age }</a></th> <th width="1000"><a class="button border-dot button-little" href="delete?id=${item.id}" onclick="return confirm('确认删除?')">删除</a> <a class="button border-dot button-little" href="upd?id=${item.id}">修改</a> </th> </tr> </c:forEach> </table> <br> <br> <button data-effect="st-effect-11">更多功能</button> </div> </div> </div> </div> </div> </div> </div> </body> `` 我的邮箱jcnotnull0108@163.com 希望大神最好能在我发的代码基础上增加 不然直接给我工具类 我也不是太明白 谢谢 代码有点多所以我删掉了一些毕竟问题他描述要10000字以内
jsp分页运行执行到链接数据库时出现这种问题,求解决
2016-9-22 10:16:03 com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin 警告: ConnectionID:4 Prelogin error: host localhost port 1434 Error reading prelogin response: at com.microso ft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnectio n .java:1368) at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection .java:1355) at com.microsoft.sqlserver.jdbc.TDSChannel.read(IOBuffer.java:1532) at com.micro soft.sqlserver.jdbc.SQLServerConnection.Prelogin(SQLServerConnection. java:1133) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnec tion.java:1054) at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.jav a:833) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection. j ava:716) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:841) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.Driv erManager.getConnection(DriverManager.java:185) at cn.jbit.easyb uy.dao.BaseDao.getConnection(BaseDao.java:29) at cn.jbit.easybuy .dao.impl.easybuy_commenDaoImpl.getPageCommentInfo(easybuy_comm enDaoImpl.java:19) at cn.jbit.easybuy.biz.impl.easybuy_commentBizImpl.getPageCommentInfo(easybuy_com mentBizImpl.java:17) at cn.jbit.easybuy.wed.PageServlet.doGet(PageServlet.java:106) at javax.servlet. http.HttpServlet.service(HttpServlet.java:620) at javax.servlet .http.HttpServlet.service(HttpServlet.java:727) at org.apache.ca talina.core.ApplicationFilterChain.internalDoFilter(ApplicationFi lterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChai n.java:208) at cn.jbit.easybuy.util.EncodeFilter.doFilter(EncodeFilter.java:23) at org.apach e.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFi lterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChai n.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.j ava:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:1 16) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) a t org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Process or.java:1040) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractP rotocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:31 5) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java :886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908
displaytag 分页问题
<%@ page language="java" contentType="text/html; charset=UTF-8"%> <%@ taglib uri="http://displaytag.sf.net" prefix="display" %> <%@include file="header.jsp" %> <style type="text/css" media="all"> @import url("/blog/admin/css/screen.css"); </style> <script type="text/javascript"> function del() { var msg = "您真的确定要删除吗?\n\n请确认!"; if (confirm(msg)==true){ return true; }else{ return false; } } </script> <h2>评论管理</h2> <display:table name="list" pagesize="4" class="its" requestURI="/servlet/CommentServlet" id="c"> <display:column property="id" title="编号" sortable="true"/> <display:column property="username" sortable="true" title="作者"/> <display:column property="content" title="内容" /> <display:column property="createdTime" title="日期" sortable="true"/> <display:column title="操作"> <a href="/blog/servlet/CommentServlet?method=edit&id=${c.id}"><img src="/blog/admin/images/edit.gif " border="0"/></a> <a href="/blog/servlet/CommentServlet?method=delete&id=${c.id}" onclick="javascript:return del()"><img src="/blog/admin/images/delete.gif" border="0"/></a> </display:column> </display:table> <%@include file="footer.jsp" %> 其他地方没有问题 就是我想点删除和修改 jsp页面中 http://localhost:8080/blog/servlet/CommentServlet?method=edit&id=${c.id} ${c.id}应该是个具体是数啊 请问我错在什么地方
datagrid根据后台数据动态显示列名与内容
已知后台返回数据格式为(1){"total":8,"rows":[{"HID":"1","HNAME":"世纪新 都","AMOUNT":"1075.00"},{"HID":"2","HNAME":"江南商 都","AMOUNT":"33.00"},{"HID":"3","HNAME":"凯瑞商都","AMOUNT":"- 51.00"},{"HID":"4","HNAME":"阳光百货","AMOUNT":"9.00"}, {"HID":"5","HNAME":"银泰百货","AMOUNT":"-35.00"}, {"HID":"281","HNAME":"测试1","AMOUNT":"-13.00"}, {"HID":"297","HNAME":"家乐福","AMOUNT":"-4.00"}, {"HID":"327","HNAME":"利比亚","AMOUNT":"-2.00"}]} (2){"total":16,"rows":[{"WAID":"1","WANO":"3001","WANAME":"上 衣","UNITS":"件","SALE":"900","KKHJ":"-35.00","KK1":"0.00","KK2":"- 20.00","KK3":"-12.00","KK4":"- 3.00","KK5":"","KK281":"","KK297":"","KK327":"","ROWNUMBER":"1.00"}, {"WAID":"47","WANO":"700096","WANAME":"工装","UNITS":" 套","SALE":"100","KKHJ":"-24.00","KK1":"-4.00","KK2":"- 1.00","KK3":"","KK4":"","KK5":"","KK281":"- 19.00","KK297":"","KK327":"","ROWNUMBER":"2.00"}, {"WAID":"12569","WANO":"3001A","WANAME":"休闲裤","UNITS":" 件","SALE":"100","KKHJ":"-24.00","KK1":"- 3.00","KK2":"2.00","KK3":"- 23.00","KK4":"","KK5":"","KK281":"","KK297":"","KK327":"","ROWNUMBER":"3.00"}, {"WAID":"6592","WANO":"A121","WANAME":"西装","UNITS":" 套","SALE":"33","KKHJ":"-23.00","KK1":"","KK2":"","KK3":"- 19.00","KK4":"","KK5":"","KK281":"","KK297":"","KK327":"- 4.00","ROWNUMBER":"4.00"},{"WAID":"21","WANO":"3006","WANAME":"牛仔 裤","UNITS":"条","SALE":"280","KKHJ":"- 14.00","KK1":"","KK2":"","KK3":"","KK4":"","KK5":"- 19.00","KK281":"5.00","KK297":"","KK327":"","ROWNUMBER":"5.00"}, {"WAID":"3","WANO":"30032","WANAME":"风衣","UNITS":" 件","SALE":"900","KKHJ":"-12.00","KK1":"18.00","KK2":"- 17.00","KK3":"3.00","KK4":"","KK5":"- 16.00","KK281":"","KK297":"","KK327":"","ROWNUMBER":"6.00"}, {"WAID":"6591","WANO":"A12","WANAME":"西装","UNITS":" 套","SALE":"0","KKHJ":"-5.00","KK1":"","KK2":"","KK3":"- 1.00","KK4":"","KK5":"","KK281":"","KK297":"- 4.00","KK327":"0.00","ROWNUMBER":"7.00"}, {"WAID":"99","WANO":"CY003","WANAME":"衬衫","UNITS":" 件","SALE":"0","KKHJ":"-1.00","KK1":"- 1.00","KK2":"","KK3":"","KK4":"","KK5":"","KK281":"","KK297":"","KK327":"","ROWNUMBER":"8.00"}, {"WAID":"1324","WANO":"NZK0869","WANAME":"睡衣","UNITS":" 双","SALE":"0","KKHJ":"- 1.00","KK1":"","KK2":"","KK3":"","KK4":"","KK5":"","KK281":"- 1.00","KK297":"","KK327":"","ROWNUMBER":"9.00"}, {"WAID":"53","WANO":"7001","WANAME":"t恤条纹","UNITS":" 件","SALE":"380","KKHJ":"0.00","KK1":"1.00","KK2":"- 1.00","KK3":"","KK4":"","KK5":"","KK281":"","KK297":"","KK327":"","ROWNUMBER":"10.00"}, {"WAID":"6572","WANO":"2543212","WANAME":"衬衫","UNITS":" 件","SALE":"44","KKHJ":"1.00","KK1":"1.00","KK2":"","KK3":"","KK4":"","KK5":"","KK281":"","KK297":"","KK327":"","ROWNUMBER":"11.00"}, {"WAID":"5","WANO":"3005","WANAME":"T恤","UNITS":" 件","SALE":"780","KKHJ":"2.00","KK1":"","KK2":"","KK3":"","KK4":"2.00","KK5":"","KK281":"","KK297":"","KK327":"","ROWNUMBER":"12.00"}, {"WAID":"48","WANO":"100330000001","WANAME":"女装雪纺衫红袖","UNITS":" 件","SALE":"500","KKHJ":"12.00","KK1":"","KK2":"12.00","KK3":"","KK4":"","KK5":"","KK281":"","KK297":"","KK327":"","ROWNUMBER":"13.00"}, {"WAID":"4","WANO":"3004","WANAME":"西便装","UNITS":" 件","SALE":"900","KKHJ":"15.00","KK1":"9.00","KK2":"","KK3":"","KK4":"5.00","KK5":"","KK281":"","KK297":"","KK327":"1.00","ROWNUMBER":"14.00"}, {"WAID":"2","WANO":"3002","WANAME":"大衣","UNITS":" 件","SALE":"900","KKHJ":"119.00","KK1":"54.00","KK2":"58.00","KK3":"1.00","KK4":"5.00","KK5":"","KK281":"","KK297":"","KK327":"1.00","ROWNUMBER":"15.00"}, {"WAID":"58","WANO":"771","WANAME":"女装-连衣裙","UNITS":" 套","SALE":"0","KKHJ":"1002.00","KK1":"1000.00","KK2":"","KK3":"","KK4":"","KK5":"","KK281":"2.00","KK297":"","KK327":"","ROWNUMBER":"16.00"}]} jsp: ``` <script type="text/javascript"> var colname=[]; var cols=[]; var ss=""; //分页设置 function pp(){ //var hide=$('#huizong').val(); //if(hide==0){ // hide1==true;hide2=true; //}else if(hide==1){ // hide1=false;hide2=true; //}else{ // hide1=true;hide2=false; //} $('#pp').pagination({//分页设置 layout:['first','links','last','manual'], pageSize:20, onSelectPage : function(pageNum, pageSize) { nouse=$('#nouse').val(); page=pageNum.toString(); getinventorydistri(page,nouse); } }); var col = [ [{ field : 'WARENAME', title : '商品', width : 20 }, { field : 'KCHJ', title : '小计', width : 20 }] ]; //s = "[["; // s = s + "{field:'WARENAME',title:'商品',width:160},{field:'COLORNAME',{field:'KCHJ',title:'小计'}"; // s = s + "]]"; var options= { idFile : 'WARENAME', width : '100%', height : '520px', fitColumns : true, striped : true, //隔行变色 rownumbers : true, //显示行数 singleSelect : true, columns:col, showFooter:true, onClickRow:function(rowIndex, rowData){ }, pageSize : 20 } //加载数据 $('#gg').datagrid(options); getinvdistridata(); setTimeout('1000'); getinvdistrisum(); setTimeout('1000'); getinventorydistri(); } //查询统计库存分布方法 function getinvdistridata(){ $('#selectd').dialog('close'); var nowdate =$('#nowdate').datebox('getValue');//当前时间 var wareid=$("#awareno").val();//货号 var adbrandid =$("#adbrandid").val();//品牌 var adtypeid=$("#adtypeid").val();//类型 var prodyear=$("#yearss").val();//生产年份 var seasonname=$("#jijie option:selected").text();//季节 //alert(nowdate); $.ajax({ type : "POST", //访问WebService使用Post方式请求 url : "InvDistriServlet", //调用WebService的地址和方法名称组合 ---- WsURL/方法名 data : { invdistriser : "getinvdistridata", nowdate:nowdate, wareid:wareid, adbrandid:adbrandid, adtypeid:adtypeid, prodyear:prodyear, seasonname:seasonname }, //这里是要传递的参数,格式为 data: "{paraName:paraValue}",下面将会看到 dataType : 'text', success : function(text) { //回调函数,result,返回值 if (text != "f") { data = $.parseJSON(text); $('#gg').datagrid('loadData', data); $('#pp').pagination({ total : data.total, }); } else { alert(text); } } }); } function getinvdistrisum(){ $('#selectd').dialog('close'); $.ajax({ type : "POST", //访问WebService使用Post方式请求 url : "InvDistriServlet", //调用WebService的地址和方法名称组合 ---- WsURL/方法名 data : { invdistriser : "getinvdistrisum" }, //这里是要传递的参数,格式为 data: "{paraName:paraValue}",下面将会看到 dataType : 'text', success : function(text) { //回调函数,result,返回值 if (text != "f") { alert(text); //colname = $.parseJSON(text); colname=text; } else { alert(text); } } }); } //查询库存分布列表方法 function getinventorydistri(page, nouse){ $('#selectd').dialog('close'); var hzfs=$("#huizong").val();//汇总方式 var wareid=$("#awareno").val();//货号 var adbrandid =$("#adbrandid").val();//品牌 var adtypeid=$("#adtypeid").val();//类型 var prodyear=$("#yearss").val();//生产年份 var seasonname=$("#jijie option:selected").text();//季节 var order=$("input[name='pai1']:checked").val();//排序方式 var paixu=$("#paixu").val();//排序项目 $.ajax({ type : "POST", //访问WebService使用Post方式请求 url : "InvDistriServlet", //调用WebService的地址和方法名称组合 ---- WsURL/方法名 data : { invdistriser : "getinvdistri", hzfs:hzfs, wareid:wareid, adbrandid:adbrandid, adtypeid:adtypeid, prodyear:prodyear, seasonname:seasonname, order:order, paixu:paixu, page:page,nouse:nouse }, //这里是要传递的参数,格式为 data: "{paraName:paraValue}",下面将会看到 dataType : 'text', success : function(text) { //回调函数,result,返回值 if (text != "f") { data = $.parseJSON(text); $('#gg').datagrid('loadData', data); $('#pp').pagination({ total : data.total, }); } else { alert(text); } } }); } </script> ``` Servlet:(为节约略去方法中从jsp取值) //库存分布数据求和及生成列表头 private void getinvdistrisum(HttpServletRequest request, HttpServletResponse response) throws Exception { Map<String,String> res = InvDistriBase.getinvdistrisum(); System.out.println("size"); System.out.println("size"+res.size()); PrintWriter out = response.getWriter(); out.print(res); out.close(); } private void getinvdistridata(HttpServletRequest request, HttpServletResponse response) throws IOException { // 获取统计库存数据 String res = InvDistriBase.getinvdistridata(); JSONObject obj = JSONObject.fromObject(res); InvDistriBase.sqltext=obj.getString("SQLTEXT"); PrintWriter out = response.getWriter(); out.print(res); out.close(); } private void getinvdistri(HttpServletRequest request, HttpServletResponse response) throws Exception { // 获得库存分页数据 String res = InvDistriBase.getinvdistri(); PrintWriter out = response.getWriter(); InvDistriBase.page = "1"; out.print(res); out.close(); }
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
面试官问我:什么是消息队列?什么场景需要他?用了会出现什么问题?
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸,打败了无数
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外
大学四年自学走来,这些珍藏的「实用工具/学习网站」我全贡献出来了
知乎高赞:文中列举了互联网一线大厂程序员都在用的工具集合,涉及面非常广,小白和老手都可以进来看看,或许有新收获。
《阿里巴巴开发手册》读书笔记-编程规约
Java编程规约命名风格 命名风格 类名使用UpperCamelCase风格 方法名,参数名,成员变量,局部变量都统一使用lowerCamelcase风格 常量命名全部大写,单词间用下划线隔开, 力求语义表达完整清楚,不要嫌名字长 ...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
你知道的越多,你不知道的越多 点赞再看,养成习惯 本文 GitHub https://github.com/JavaFamily 已收录,有一线大厂面试点思维导图,也整理了很多我的文档,欢迎Star和完善,大家面试可以参照考点复习,希望我们一起有点东西。 前前言 为啥今天有个前前言呢? 因为你们的丙丙啊,昨天有牌面了哟,直接被微信官方推荐,知乎推荐,也就仅仅是还行吧(心里乐开花)
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
Python爬虫精简步骤1 获取数据
爬虫的工作分为四步: 1.获取数据。爬虫程序会根据我们提供的网址,向服务器发起请求,然后返回数据。 2.解析数据。爬虫程序会把服务器返回的数据解析成我们能读懂的格式。 3.提取数据。爬虫程序再从中提取出我们需要的数据。 4.储存数据。爬虫程序把这些有用的数据保存起来,便于你日后的使用和分析。 这一篇的内容就是:获取数据。 首先,我们将会利用一个强大的库——requests来获取数据。 在电脑上安装
Python绘图,圣诞树,花,爱心 | Turtle篇
1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle() circle.shape('circle') circle.color('red') circle.speed('fastest') circle.up() square = turtle.Turtle()
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 更多有趣分析教程,扫描下方二维码关注vx公号「裸睡的猪」 即可查看! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布
听说想当黑客的都玩过这个Monyer游戏(1~14攻略)
第零关 进入传送门开始第0关(游戏链接) 请点击链接进入第1关: 连接在左边→ ←连接在右边 看不到啊。。。。(只能看到一堆大佬做完的留名,也能看到菜鸡的我,在后面~~) 直接fn+f12吧 &lt;span&gt;连接在左边→&lt;/span&gt; &lt;a href="first.php"&gt;&lt;/a&gt; &lt;span&gt;←连接在右边&lt;/span&gt; o
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
别低估自己的直觉,也别高估自己的智商
所有群全部吵翻天,朋友圈全部沦陷,公众号疯狂转发。这两周没怎么发原创,只发新闻,可能有人注意到了。我不是懒,是文章写了却没发,因为大家的关注力始终在这次的疫情上面,发了也没人看。当然,我...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。   再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。   下文是原回答,希望能对你能有所启发。   如果我说,这个世界上人真的分三六九等,
为什么听过很多道理,依然过不好这一生?
记录学习笔记是一个重要的习惯,不希望学习过的东西成为过眼云烟。做总结的同时也是一次复盘思考的过程。 本文是根据阅读得到 App上《万维钢·精英日课》部分文章后所做的一点笔记和思考。学习是一个系统的过程,思维模型的建立需要相对完整的学习和思考过程。以下观点是在碎片化阅读后总结的一点心得总结。
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
如何优雅地打印一个Java对象?
你好呀,我是沉默王二,一个和黄家驹一样身高,和刘德华一样颜值的程序员。虽然已经写了十多年的 Java 代码,但仍然觉得自己是个菜鸟(请允许我惭愧一下)。 在一个月黑风高的夜晚,我思前想后,觉得再也不能这么蹉跎下去了。于是痛下决心,准备通过输出的方式倒逼输入,以此来修炼自己的内功,从而进阶成为一名真正意义上的大神。与此同时,希望这些文章能够帮助到更多的读者,让大家在学习的路上不再寂寞、空虚和冷。 ...
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计
Linux 命令(122)—— watch 命令
1.命令简介 2.命令格式 3.选项说明 4.常用示例 参考文献 [1] watch(1) manual
Linux 命令(121)—— cal 命令
1.命令简介 2.命令格式 3.选项说明 4.常用示例 参考文献 [1] cal(1) manual
记jsp+servlet+jdbc实现的新闻管理系统
1.工具:eclipse+SQLyog 2.介绍:实现的内容就是显示新闻的基本信息,然后一个增删改查的操作。 3.数据库表设计 列名 中文名称 数据类型 长度 非空 newsId 文章ID int 11 √ newsTitle 文章标题 varchar 20 √ newsContent 文章内容 text newsStatus 是否审核 varchar 10 news...
Python新型冠状病毒疫情数据自动爬取+统计+发送报告+数据屏幕(三)发送篇
今天介绍的项目是使用 Itchat 发送统计报告 项目功能设计: 定时爬取疫情数据存入Mysql 进行数据分析制作疫情报告 使用itchat给亲人朋友发送分析报告(本文) 基于Django做数据屏幕 使用Tableau做数据分析 来看看最终效果 目前已经完成,预计2月12日前更新 使用 itchat 发送数据统计报告 itchat 是一个基于 web微信的一个框架,但微信官方并不允
作为程序员的我,大学四年一直自学,全靠这些实用工具和学习网站!
我本人因为高中沉迷于爱情,导致学业荒废,后来高考,毫无疑问进入了一所普普通通的大学,实在惭愧...... 我又是那么好强,现在学历不行,没办法改变的事情了,所以,进入大学开始,我就下定决心,一定要让自己掌握更多的技能,尤其选择了计算机这个行业,一定要多学习技术。 在进入大学学习不久后,我就认清了一个现实:我这个大学的整体教学质量和学习风气,真的一言难尽,懂的人自然知道怎么回事? 怎么办?我该如何更好的提升
相关热词 c# 识别回车 c#生成条形码ean13 c#子控制器调用父控制器 c# 写大文件 c# 浏览pdf c#获取桌面图标的句柄 c# list反射 c# 句柄 进程 c# 倒计时 线程 c# 窗体背景色
立即提问