jsp页面中使用foreach遍历一个list集合时

jsp页面中使用foreach遍历一个list集合时,item获取的是list本身,还是list得名字

3个回答

for (List item : list) 前面的List是代表类型,后面的list是名字

你说的是jsp的c:forEach 么?items = "list名字" var="自定义名字";为了减少错误,一般把两个值命名为一样。

sinat_33164199
sinat_33164199 谢谢
大约 4 年之前 回复

item获得的是list中的元素呀

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
JSP中通过c:forEach遍历集合, 集合能取到, var属性指定的临时变量取不到
controller中的代码 @RequestMapping("/findAll") public ModelAndView findAll() { List<User> users = us.findAll(); mv.addObject("users", users); mv.setViewName("user"); return mv; } JSP中的代码 <script> $(function () { <c:forEach items="${users}" var="user"> alert(${user.name}); </c:forEach> }) </script> 浏览器查看控制台会提示 Uncaught ReferenceError: 元素名 is not defined alert中写成 alert(user)或者alert(user.name)都不行,但是写成${users},即弹这个集合可以成功
jsp中核心标签库的foreach标签用不了
在jsp页面中增加了一个表格,表格中的某一列使用foreach遍历list集合,代码却全都在这一行的第一列,而且在网页上显示不了,求大神!!![图片说明](https://img-ask.csdn.net/upload/201607/23/1469269603_492970.png)![图片说明](https://img-ask.csdn.net/upload/201607/23/1469269713_6644.png)![图片说明](https://img-ask.csdn.net/upload/201607/23/1469269720_636091.png)
java中如何用<c:foreach>迭代出list集合中的map集合中的value值
action中的代码片段: int i = 0; Map map = new HashMap(); List list = new ArrayList(); map.put(i,ci); //ci是个Book对象 i++; list.add(map); session.put("list",list); //实现了SessionAware接口 那么我在JSP页面中要如何迭代出ci中的各个属性啊?或者我action哪里写错了? <c:forEach items="${list}" var="map" varStatus="status"> ${map.value.bname} </c:foreach> 现在迭代出来的是空
如何用jstl<c:forEach>标签获取list集合中的元素·。
@RequestMapping("/listUser.do") public String list(HttpServletRequest request,HttpSession session,HttpServletResponse response) { try { java.util.List<User> list =lus.find(); System.out.println(list); request.setAttribute("user",list); return "listUser"; } catch (Exception e) { return "error"; } } ![jsp中的代码片段](https://img-ask.csdn.net/upload/201902/25/1551062259_636672.png) ![页面显示结果为空](https://img-ask.csdn.net/upload/201902/25/1551062313_661583.png) ## ```请问什么地方错误了,最好能帮忙远程协助。 ``` ```
mybatis在使用foreach进行List集合查询时,sql映射时多余问号,网上没有类似问题,求大神指教
近日,在编写Spring Mvc的时候,出现一个特别怪的事情,我正常使用 ``` <select id="findListWithIdsString" resultType="OrderProduct" parameterType="java.util.List"> SELECT <include refid="orderProductOwnColumns"/> a.del_flag AS "delFlag" FROM tbl_order_product a <where> a.del_flag = '0' AND a.id in ('XXXXX','XXXX') </where> </select> ``` 以上这个这个是** 没问题的**,但是,当我改为从java**传值List**的时候,就出问题了,xml代码: ``` <select id="findListWithIdsString" resultType="OrderProduct" parameterType="java.util.List"> SELECT <include refid="orderProductOwnColumns"/> a.del_flag AS "delFlag" FROM tbl_order_product a <where> a.del_flag = '0' <choose> <when test="inComingIds != null and inComingIds.size()>0"> AND a.id in <foreach collection="inComingIds" item="item" index="index" open="(" close=")" separator="," >                  #{item}              </foreach> </when> <otherwise> AND a.id='0' </otherwise> </choose> </where> </select> ``` 然后我的前java端代码是: ``` List<String> idList=new ArrayList<>();//传入的List String opIds=mp.getRelatedOrderProductIds();//前端获取的String Collections.addAll(idList,StringUtils.split(opIds, ","));//转化为List OrderProduct opForSearch=new OrderProduct(); opForSearch.setInComingIds(idList); orderProductService.findListWithIdsString(opForSearch); ``` 数据库配置如下: ``` ?useUnicode=true&characterEncoding=utf-8 ``` 出错信息: ``` 2019-05-01 15:28:43,034 DEBUG [modules.sys.dao.OrderProductDao.findListWithIdsString] - ==> Preparing: SELECT a.id AS "id", a.order_id AS "order.id", a.actual_flow_id AS "actualFlowId", a.category_id AS "companyCategory.id", a.parent_order_product_id as "parentOrderProductId", a.price AS "price", a.amount AS "amount", a.product_name AS "productName", a.a_product_name AS "aProductName", a.product_description AS "productDescription", a.delivery_time AS "deliveryTime", a.rate AS "rate", a.is_a_confirm AS "isAConfirm", a.confirm_userid AS "confirmUserid", a.A_confirm_time AS "aConfirmTime", a.order_product_type AS "orderProductType", a.inner_delivery_time AS "innerDeliveryTime", a.companyB_priority AS "companyBPriority", a.companyA_priority AS "companyAPriority", a.order_product_status AS "orderProductStatus", a.product_sn AS "productSn", a.a_product_sn AS "aProductSn", a.source AS "source", a.A_company_id AS "aCompany.id", a.B_company_id AS "bCompany.id", a.take_materiel_status AS "takeMaterielStatus", a.create_by AS "createBy.id", a.create_date AS "createDate", a.update_by AS "updateBy.id", a.update_date AS "updateDate", "ORDER_PRODUCT" AS "resourceType", a.remarks AS "remarks", a.down_order_status AS "downOrderStatus", a.batch_number AS "batchNumber", a.closure AS "closure", a.closure_money AS "closureMoney", a.del_flag AS "delFlag" FROM tbl_order_product a WHERE a.del_flag = '0' AND a.id in ( ???????????? ??? ? ???????? ??? , ???????????? ??? ? ???????? ??? ) 2019-05-01 15:28:43,034 DEBUG [modules.sys.dao.OrderProductDao.findListWithIdsString] - ==> Parameters: 54eca8e0409a4f5b81919ecbf7b85d44(String), 4fda20df078945aeaae3960f265795c1(String) 2019-05-01 15:28:43,094 ERROR [500.jsp] - ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 ### The error may exist in D:\apache-tomcat-8.0.53-ft\webapps\blanink-web\WEB-INF\classes\mappings\modules\sys\OrderProductDao.xml ### The error may involve com.blanink.business.modules.sys.dao.OrderProductDao.findListWithIdsString-Inline ### The error occurred while setting parameters ### SQL: SELECT a.id AS "id", a.order_id AS "order.id", a.actual_flow_id AS "actualFlowId", a.category_id AS "companyCategory.id", a.parent_order_product_id as "parentOrderProductId", a.price AS "price", a.amount AS "amount", a.product_name AS "productName", a.a_product_name AS "aProductName", a.product_description AS "productDescription", a.delivery_time AS "deliveryTime", a.rate AS "rate", a.is_a_confirm AS "isAConfirm", a.confirm_userid AS "confirmUserid", a.A_confirm_time AS "aConfirmTime", a.order_product_type AS "orderProductType", a.inner_delivery_time AS "innerDeliveryTime", a.companyB_priority AS "companyBPriority", a.companyA_priority AS "companyAPriority", a.order_product_status AS "orderProductStatus", a.product_sn AS "productSn", a.a_product_sn AS "aProductSn", a.source AS "source", a.A_company_id AS "aCompany.id", a.B_company_id AS "bCompany.id", a.take_materiel_status AS "takeMaterielStatus", a.create_by AS "createBy.id", a.create_date AS "createDate", a.update_by AS "updateBy.id", a.update_date AS "updateDate", "ORDER_PRODUCT" AS "resourceType", a.remarks AS "remarks", a.down_order_status AS "downOrderStatus", a.batch_number AS "batchNumber", a.closure AS "closure", a.closure_money AS "closureMoney", a.del_flalag AS "delFlag" FROM tbl_order_product a WHERE a.del_flag = '0' AND a.id in ( ???????????? ??? ? ???????? ??? , ???????????? ??? ? ???????? ??? ) ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 ### The error may exist in D:\apache-tomcat-8.0.53-ft\webapps\blanink-web\WEB-INF\classes\mappings\modules\sys\OrderProductDao.xml ### The error may involve com.blanink.business.modules.sys.dao.OrderProductDao.findListWithIdsString-Inline ### The error occurred while setting parameters ### SQL: SELECT a.id AS "id", a.order_id AS "order.id", a.actual_flow_id AS "actualFlowId", a.category_id AS "companyCategory.id", a.parent_order_product_id as "parentOrderProductId", a.price AS "price", a.amount AS "amount", a.product_name AS "productName", a.a_product_name AS "aProductName", a.product_description AS "productDescription", a.delivery_time AS "deliveryTime", a.rate AS "rate", a.is_a_confirm AS "isAConfirm", a.confirm_userid AS "confirmUserid", a.A_confirm_time AS "aConfirmTime", a.order_product_type AS "orderProductType", a.inner_delivery_time AS "innerDeliveryTime", a.companyB_priority AS "companyBPriority", a.companyA_priority AS "companyAPriority", a.order_product_status AS "orderProductStatus", a.product_sn AS "productSn", a.a_product_sn AS "aProductSn", a.source AS "source", a.A_company_id AS "aCompany.id", a.B_company_id AS "bCompany.id", a.take_materiel_status AS "takeMaterielStatus", a.create_by AS "createBy.id", a.create_date AS "createDate", a.update_by AS "updateBy.id", a.update_date AS "updateDate", "ORDER_PRODUCT" AS "resourceType", a.remarks AS "remarks", a.down_order_status AS "downOrderStatus", a.batch_number AS "batchNumber", a.closure AS "closure", a.closure_money AS "closureMoney", a.del_flag AS "delFlag", a.del_flag AS "delFlag" FROM tbl_order_product a WHERE a.del_flag = '0' AND a.id in ( ???????????? ??? ? ???????? ??? , ???????????? ??? ? ???????? ??? ) ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:399) at com.sun.proxy.$Proxy27.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:205) at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:119) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63) ```
mybatis在使用foreach进行List集合查询时,出现sql映射很多问号,不是乱码,就是多了很多问号
近日,在编写Spring Mvc的时候,出现一个特别怪的事情,我正常使用 <select id="findListWithIdsString" resultType="OrderProduct" parameterType="java.util.List"> SELECT <include refid="orderProductOwnColumns"/> a.del_flag AS "delFlag" FROM tbl_order_product a <where> a.del_flag = '0' AND a.id in ('XXXXX','XXXX') </where> </select> 这个是没问题的,但是,当我改为从java传至List的时候,就出问题了,xml代码: <select id="findListWithIdsString" resultType="OrderProduct" parameterType="java.util.List"> SELECT <include refid="orderProductOwnColumns"/> a.del_flag AS "delFlag" FROM tbl_order_product a <where> a.del_flag = '0' <choose> <when test="inComingIds != null and inComingIds.size()>0"> AND a.id in <foreach collection="inComingIds" item="item" index="index" open="(" close=")" separator="," >                  #{item}              </foreach> </when> <otherwise> AND a.id='0' </otherwise> </choose> </where> </select> 然后我的前java端代码是: List<String> idList=new ArrayList<>();//传入的List String opIds=mp.getRelatedOrderProductIds();//前端获取的String Collections.addAll(idList,StringUtils.split(opIds, ","));//转化为List OrderProduct opForSearch=new OrderProduct(); opForSearch.setInComingIds(idList); orderProductService.findListWithIdsString(opForSearch); 数据库配置如下: ?useUnicode=true&characterEncoding=utf-8 出错信息: 2019-05-01 15:28:43,034 DEBUG [modules.sys.dao.OrderProductDao.findListWithIdsString] - ==> Preparing: SELECT a.id AS "id", a.order_id AS "order.id", a.actual_flow_id AS "actualFlowId", a.category_id AS "companyCategory.id", a.parent_order_product_id as "parentOrderProductId", a.price AS "price", a.amount AS "amount", a.product_name AS "productName", a.a_product_name AS "aProductName", a.product_description AS "productDescription", a.delivery_time AS "deliveryTime", a.rate AS "rate", a.is_a_confirm AS "isAConfirm", a.confirm_userid AS "confirmUserid", a.A_confirm_time AS "aConfirmTime", a.order_product_type AS "orderProductType", a.inner_delivery_time AS "innerDeliveryTime", a.companyB_priority AS "companyBPriority", a.companyA_priority AS "companyAPriority", a.order_product_status AS "orderProductStatus", a.product_sn AS "productSn", a.a_product_sn AS "aProductSn", a.source AS "source", a.A_company_id AS "aCompany.id", a.B_company_id AS "bCompany.id", a.take_materiel_status AS "takeMaterielStatus", a.create_by AS "createBy.id", a.create_date AS "createDate", a.update_by AS "updateBy.id", a.update_date AS "updateDate", "ORDER_PRODUCT" AS "resourceType", a.remarks AS "remarks", a.down_order_status AS "downOrderStatus", a.batch_number AS "batchNumber", a.closure AS "closure", a.closure_money AS "closureMoney", a.del_flag AS "delFlag" FROM tbl_order_product a WHERE a.del_flag = '0' AND a.id in ( ???????????? ??? ? ???????? ??? , ???????????? ??? ? ???????? ??? ) 2019-05-01 15:28:43,034 DEBUG [modules.sys.dao.OrderProductDao.findListWithIdsString] - ==> Parameters: 54eca8e0409a4f5b81919ecbf7b85d44(String), 4fda20df078945aeaae3960f265795c1(String) 2019-05-01 15:28:43,094 ERROR [500.jsp] - ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 ### The error may exist in D:\apache-tomcat-8.0.53-ft\webapps\blanink-web\WEB-INF\classes\mappings\modules\sys\OrderProductDao.xml ### The error may involve com.blanink.business.modules.sys.dao.OrderProductDao.findListWithIdsString-Inline ### The error occurred while setting parameters ### SQL: SELECT a.id AS "id", a.order_id AS "order.id", a.actual_flow_id AS "actualFlowId", a.category_id AS "companyCategory.id", a.parent_order_product_id as "parentOrderProductId", a.price AS "price", a.amount AS "amount", a.product_name AS "productName", a.a_product_name AS "aProductName", a.product_description AS "productDescription", a.delivery_time AS "deliveryTime", a.rate AS "rate", a.is_a_confirm AS "isAConfirm", a.confirm_userid AS "confirmUserid", a.A_confirm_time AS "aConfirmTime", a.order_product_type AS "orderProductType", a.inner_delivery_time AS "innerDeliveryTime", a.companyB_priority AS "companyBPriority", a.companyA_priority AS "companyAPriority", a.order_product_status AS "orderProductStatus", a.product_sn AS "productSn", a.a_product_sn AS "aProductSn", a.source AS "source", a.A_company_id AS "aCompany.id", a.B_company_id AS "bCompany.id", a.take_materiel_status AS "takeMaterielStatus", a.create_by AS "createBy.id", a.create_date AS "createDate", a.update_by AS "updateBy.id", a.update_date AS "updateDate", "ORDER_PRODUCT" AS "resourceType", a.remarks AS "remarks", a.down_order_status AS "downOrderStatus", a.batch_number AS "batchNumber", a.closure AS "closure", a.closure_money AS "closureMoney", a.del_flalag AS "delFlag" FROM tbl_order_product a WHERE a.del_flag = '0' AND a.id in ( ???????????? ??? ? ???????? ??? , ???????????? ??? ? ???????? ??? ) ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 ### The error may exist in D:\apache-tomcat-8.0.53-ft\webapps\blanink-web\WEB-INF\classes\mappings\modules\sys\OrderProductDao.xml ### The error may involve com.blanink.business.modules.sys.dao.OrderProductDao.findListWithIdsString-Inline ### The error occurred while setting parameters ### SQL: SELECT a.id AS "id", a.order_id AS "order.id", a.actual_flow_id AS "actualFlowId", a.category_id AS "companyCategory.id", a.parent_order_product_id as "parentOrderProductId", a.price AS "price", a.amount AS "amount", a.product_name AS "productName", a.a_product_name AS "aProductName", a.product_description AS "productDescription", a.delivery_time AS "deliveryTime", a.rate AS "rate", a.is_a_confirm AS "isAConfirm", a.confirm_userid AS "confirmUserid", a.A_confirm_time AS "aConfirmTime", a.order_product_type AS "orderProductType", a.inner_delivery_time AS "innerDeliveryTime", a.companyB_priority AS "companyBPriority", a.companyA_priority AS "companyAPriority", a.order_product_status AS "orderProductStatus", a.product_sn AS "productSn", a.a_product_sn AS "aProductSn", a.source AS "source", a.A_company_id AS "aCompany.id", a.B_company_id AS "bCompany.id", a.take_materiel_status AS "takeMaterielStatus", a.create_by AS "createBy.id", a.create_date AS "createDate", a.update_by AS "updateBy.id", a.update_date AS "updateDate", "ORDER_PRODUCT" AS "resourceType", a.remarks AS "remarks", a.down_order_status AS "downOrderStatus", a.batch_number AS "batchNumber", a.closure AS "closure", a.closure_money AS "closureMoney", a.del_flag AS "delFlag", a.del_flag AS "delFlag" FROM tbl_order_product a WHERE a.del_flag = '0' AND a.id in ( ???????????? ??? ? ???????? ??? , ???????????? ??? ? ???????? ??? ) ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??? '54eca8e0409a4f5b81919ecbf7b85d44' ???????? ??? , ?????' at line 47 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:399) at com.sun.proxy.$Proxy27.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:205) at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:119) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)
如何在JSP页面中,把数组中的TreeSet中的实体存储地址变成实体对象
首先,感谢大家抽时间看我这问题. 问题阐述: 我在做Spring Hibernate和struts整合的实验,之前,我在Action类中已经将要放在页面中的数据,传到JSP页面中,以下是Action类的代码: /** * 显示所有的商品分类 * * * @return */ public void showAllCategory() { try { List<CategoryDTO> resultList = this.categoryService.showAllCategory(); this.getRequest().put("initCategoryList", resultList); } catch (Exception e) { e.printStackTrace(); } } 以下是categoryDTO中的类属性 /** * 类别编号 */ private Long id; /** * 类别名称 */ private String name; /** * 商品集合 */ private Set<ProductQueryDTO> products = new HashSet<ProductQueryDTO>(); /** * 子类别 */ private Set<CategoryDTO> categories = new TreeSet<CategoryDTO>(); 由于我想弄个导航条,如:家电->电冰箱 所以想在JSP页面中用foreach来循环打印出所有商品,不知道我说的够不够明白,欢迎追问. 问题来了,我先上JSP页面的代码 <c:forEach items="${requestScope.initCategoryList}" var="categoryDTO" varStatus="vs"> <ul> <a ><strong>${categoryDTO.name }</strong></a> <c:forEach items="${categoryDTO.categories } " var="category" varStatus="vs1"> <li><a >${category}</a></li> </c:forEach> </ul> </c:forEach> 但是,我只能把最基本的父类的商品种类打印出来,而家电下面则显示实体DTO的物理地址,可以看以下图 ![CSDN移动问答][1] 我想问,怎样才能把这个子种类中的种类名字弄出来?${category.name}会报错. 我目前是这样的 ![CSDN移动问答][2] [1]: http://img.my.csdn.net/uploads/201403/10/1394439687_2814.png [2]: http://img.my.csdn.net/uploads/201403/10/1394439837_7267.png
javaweb如何实现点击商品页面跳转到本商品的详情页面
以上是jsp页面的代码,我是通过将从数据库获取到的所有商品封装到一个list集合中,使用request域存储数据,在jsp页面使用el获取的所有商品。我现在能否在这个基础上面实现点击商品,进入到本商品的详情界面,页面已经写好了。我自己的实现逻辑是:通过某个域存储商品的id信息,在servlet中获取到,去数据库中查找这件商品的所有信息,这个商品存这储到域空间中,在新的页面通过el获取,但是目前我无法实现将这个商品的id信息传存储到域空间中。我不知道这样能不能实现,是不是我的想法有错误,希望大神帮个忙!!! ``` <c:forEach items="${productList }" var="product"> <div class="col-md-2" style="height:250px"> <a href="product_info.htm"> <img src="${pageContext.request.contextPath }/${product.pimage }" width="170" height="170" style="display: inline-block;"> </a> <p> <a href="/WEB18/productOne" style='color: green'>${product.pname }</a> </p> <p> <font color="#FF0000">商城价:&yen;${product.shop_price }</font> </p> </div> </c:forEach> ``` 上面是所有商品的jsp页面的代码。
没找到问题在哪!!大神帮忙看一下代码(JSP使用JSTL的c:forEach标签显示数据怎么不管用
``` <form name="myform" method="post" action="newstypeservlet?op=batchDelete"> <table border="1"> <tr> <th>编号</th> <th>类型名</th> <th>编辑</th> <th>删除</th> </tr> <c:forEach items="${requestScope.newsTypeList }" var="newsType" varStatus="status"> <tr style="background-color: ${status.index%2==0?'red':'green' } "> <td> <input type="checkbox" name="ids" value="${newsType.id }"/> ${newsType.id } </td> <td>${newsType.typeName }</td> <td><a href="newstypeservlet?op=toEdit&id=${newsType.id }">编辑</a></td> <td><a href="newstypeservlet?op=delete&id=${newsType.id }">删除</a></td> </tr> </c:forEach> <tr> <td colspan="4" > <input type="button" value="批量删除" onclick="checkSelected()"/> </td> </tr> </table> </form> ``` Servlet里的代码: ``` protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // System.out.println("进入sevlet"); request.setCharacterEncoding("UTF-8");// 解决Post提交时的乱码问题 String op = request.getParameter("op");// 注意:此处的JSP页面不放在根目录下,Servlet就无法接收到页面传来的数据,因为web.xml配置信息无法覆盖 if ("add".equals(op)) { addNewsType(request, response); } else if ("list".equals(op)) { listNewsType(request, response); } else if ("batchDelete".equals(op)) { batchDelete(request, response); } else if ("delete".equals(op)) { deleteById(request, response); } } // 新闻列表 private void listNewsType(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { NewsTypeService newsTypeService = new NewsTypeService(); List<NewsType> newsTypeList = newsTypeService.findAll(); request.setAttribute("newsTypeList", newsTypeList); request.getRequestDispatcher("../listNewsType.jsp").forward(request, response); } private void deleteById(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { PrintWriter out = response.getWriter(); String idStr = request.getParameter("id"); if (idStr == null || "".equals(idStr)) { out.write("<script>alert('密码不能为空');history.back();</script>"); return; } int id = Integer.parseInt(idStr); NewsTypeService newsTypeService = new NewsTypeService(); newsTypeService.delete(id); // 删除数据后,返回列表 listNewsType(request, response); } private void batchDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String[] ids = request.getParameterValues("ids"); NewsTypeService newsTypeService = new NewsTypeService(); newsTypeService.batchDelete(ids); // 删除数据后,返回列表 listNewsType(request, response); } ``` service代码: ``` public class NewsTypeService { public int save(NewsType newsType) { return new NewsTypeDao().save(newsType); } public int batchDelete(String[] ids) { return new NewsTypeDao().batchDelete(ids); } public List<NewsType> findAll() { return new NewsTypeDao().findAll(); } public int delete(int id) { return new NewsTypeDao().delete(id); } ``` DAO里的代码 ``` public class NewsTypeDao { DBUtil dbUtil = new DBUtil(); // 保存新闻类型 public int save(NewsType newsType) { String sql = "insert into newstype(typeName) values (?)"; Object[] params = { newsType.getTypeName() }; return dbUtil.executeUpdate(sql, params); // executeUpdate的返回值是一个整数,指示受影响的行数(即更新计数) } public List<NewsType> findAll() { List<NewsType> newsTypeList = new ArrayList<NewsType>(); String sql = "select * from newstype"; ResultSet rs = dbUtil.executeQuery(sql, null); try { while (rs.next()) { NewsType newsType = new NewsType(rs.getInt("id"), rs.getString("typeName")); newsTypeList.add(newsType); } } catch (SQLException e) { e.printStackTrace(); return newsTypeList; } finally { dbUtil.closeAll(); } return newsTypeList; } /** * 批量删除 * * @param ids * 指定的ID集合 * @return */ public int batchDelete(String[] ids) { // TODO Auto-generated method stub String sql = "delete from newstype where id in(?)"; Object[] params = { ArrayUtil.array2String(ids, ",") }; return dbUtil.executeUpdate(sql, params); } /** * 根据Id进行删除 * * @param id * @return */ public int delete(int id) { String sql = "delete from newsType where id=?"; Object[] params = { id }; return dbUtil.executeUpdate(sql, params); } ## # }谢谢大神**** ```
jstl怎么在页面输出List 急。。。。
我在Action查出的 List数据集合 list里面放的是Map 怎么在jsp页面接收数据进行输出呢? [b]问题补充:[/b] 谢谢您的回答 可是输出的结果是: ${mymap.key} ${mymap.value} 我在Action:request.setAttribute("list", yhxx); 页面直接就是: <c:forEach items="${list}" var="item" > <c:forEach items="${item}" var="mymap" > <c:out value="${mymap.key}" /> <c:out value="${mymap.value}" /> </c:forEach> </c:forEach>
ssh jsp的list怎么样传到后台。在action里获取到值
``` <c:forEach items="${list}" var="item" varStatus="status"> <tr ${status.index%2!=0?"class='odd'":""}> <td style="width: 5%; text-align: center;">${item.xmbm}</td> <td style="width: 20%;">${item.kjkm}</td> <td style="width: 10%; text-align: right;">${item.sj}</td> <td align="right" style="width: 10%;"><input name="bqlj" id="bqlj${status.index}" value="${item.bqlj}" class="text" maxlength="8" onchange="this.value=cc(this.value)" type="text" /></td> <td style="width: 10%; text-align: right;">${item.tqlj}</td> <td style="width: 10%; text-align: right;">${item.zje}</td> <td style="width: 10%; text-align: center;">${item.zjl}</td> <td style="width: 15%;"><input id="bz${status.index}" name="bz${status.index}" value="${item.bz}" type="text" /></td> </tr> </c:forEach> ``` 在action里如何获取到这个list? 求解答。。 现在是在数据库中取出来一个list集合,表示在画面上,然后在画面上进行更改,点保存按钮再把这个list传到后台进行更新。我现在的框架是ssh。list是用javabean做的,javabean里也都有getset方法,现在就是反不回去list,一回去就是个null
JSP页面无法显示数据库信息???求助啊!有图有代码,求大神雪中送炭
JSP页面显示这样:![图片说明](https://img-ask.csdn.net/upload/201504/20/1429541114_426572.png) JSP代码: ``` <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="../base.jsp"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>新闻类型列表</title> <style type="text/css"> body{ background-image: url("images/bg_newsDetailList1.jpg"); background-position:-100px -300px; } .enableStyle{ background-color: ; color:black; } .disableStyle{ background-color: red; color: white; } </style> <script type="text/javascript"> function checkSelected(){ var flag=false; var ids=document.getElementsByName("ids"); for(var i=0;i<ids.length;i++){ if(ids[i].checked){ flag=true; break; } } if(!flag){ alert("请选择需要删除的数据!"); }else{ if(confirm("确定要删除选中的数据吗?")){ document.myform.submit(); } } } </script> </head> <body> <form name="myform" method="post" action="newstypeservlet?op=batchDelete"> <table border="1"> <tr> <th>编号</th> <th>类型名</th> <th>编辑</th> <th>删除</th> </tr> <c:forEach items="${requestScope.newsTypeList }" var="newsType" varStatus="status"> <tr style="background-color: ${status.index%2==0?'red':'green' } "> <td> <input type="checkbox" name="ids" value="${newsType.id }"/> ${newsType.id } </td> <td>${newsType.typeName }</td> <td><a href="newstypeservlet?op=toEdit&id=${newsType.id }">编辑</a></td> <td><a href="newstypeservlet?op=delete&id=${newsType.id }">删除</a></td> </tr> </c:forEach> <tr> <td colspan="4" > <input type="button" value="批量删除" onclick="checkSelected()"/> </td> </tr> </table> </form> </body> </html> ``` 其中base.jsp代码如下: ``` <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <base href="<%=basePath %>" /> ``` Servlet代码: ``` protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // System.out.println("进入sevlet"); request.setCharacterEncoding("UTF-8");// 解决Post提交时的乱码问题 String op = request.getParameter("op");// 注意:此处的JSP页面不放在根目录下,Servlet就无法接收到页面传来的数据,因为web.xml配置信息无法覆盖 if ("add".equals(op)) { addNewsType(request, response); } else if ("list".equals(op)) { listNewsType(request, response); } else if ("batchDelete".equals(op)) { batchDelete(request, response); } else if ("delete".equals(op)) { deleteById(request, response); } } // 新闻列表 private void listNewsType(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { NewsTypeService newsTypeService = new NewsTypeService(); List<NewsType> newsTypeList = newsTypeService.findAll(); request.setAttribute("newsTypeList", newsTypeList); request.getRequestDispatcher("../listNewsType.jsp").forward(request, response); } private void deleteById(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { PrintWriter out = response.getWriter(); String idStr = request.getParameter("id"); if (idStr == null || "".equals(idStr)) { out.write("<script>alert('密码不能为空');history.back();</script>"); return; } int id = Integer.parseInt(idStr); NewsTypeService newsTypeService = new NewsTypeService(); newsTypeService.delete(id); // 删除数据后,返回列表 listNewsType(request, response); } private void batchDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String[] ids = request.getParameterValues("ids"); NewsTypeService newsTypeService = new NewsTypeService(); newsTypeService.batchDelete(ids); // 删除数据后,返回列表 listNewsType(request, response); } ``` service代码: ``` package com.syf.service; import java.util.List; import com.syf.dao.NewsTypeDao; import com.syf.entity.NewsType; public class NewsTypeService { public int save(NewsType newsType) { return new NewsTypeDao().save(newsType); } public int batchDelete(String[] ids) { return new NewsTypeDao().batchDelete(ids); } public List<NewsType> findAll() { return new NewsTypeDao().findAll(); } public int delete(int id) { return new NewsTypeDao().delete(id); } } ``` DAO层代码: ``` package com.syf.dao; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import com.syf.entity.NewsType; import com.syf.util.ArrayUtil; import com.syf.util.DBUtil; public class NewsTypeDao { DBUtil dbUtil = new DBUtil(); // 保存新闻类型 public int save(NewsType newsType) { String sql = "insert into newstype(typeName) values (?)"; Object[] params = { newsType.getTypeName() }; return dbUtil.executeUpdate(sql, params); // executeUpdate的返回值是一个整数,指示受影响的行数(即更新计数) } public List<NewsType> findAll() { List<NewsType> newsTypeList = new ArrayList<NewsType>(); String sql = "select * from newstype"; ResultSet rs = dbUtil.executeQuery(sql, null); try { while (rs.next()) { NewsType newsType = new NewsType(rs.getInt("id"), rs.getString("typeName")); newsTypeList.add(newsType);// 将对象放入到集合 } } catch (SQLException e) { e.printStackTrace(); return newsTypeList; } finally { dbUtil.closeAll(); } return newsTypeList; } /** * 批量删除 * * @param ids * 指定的ID集合 * @return */ public int batchDelete(String[] ids) { // TODO Auto-generated method stub String sql = "delete from newstype where id in(?)"; Object[] params = { ArrayUtil.array2String(ids, ",") }; return dbUtil.executeUpdate(sql, params); } /** * 根据Id进行删除 * * @param id * @return */ public int delete(int id) { String sql = "delete from newsType where id=?"; Object[] params = { id }; return dbUtil.executeUpdate(sql, params); } } ``` entity实体类代码: ``` package com.syf.entity; public class NewsType { private int id; private String typeName; public NewsType() { super(); } public NewsType(String typeName) { super(); this.typeName = typeName; } public NewsType(int id, String typeName) { super(); this.id = id; this.typeName = typeName; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getTypeName() { return typeName; } public void setTypeName(String typeName) { this.typeName = typeName; } } ```
一个关于使用JavaBean的问题(新手qiu'zhu)
要求: ## 在Servlet中创建一个List<用户JavaBean>对象,在List集合对象中存放多个用户JavaBean对象,并将该List集合对象存放在request对象中,最后跳转到users页面;在users页面使用JSTL和EL将List对象取出来,并以表格的形式展示出List中的每个用户信息。 Servlet.java ``` package cuit; import java.util.List; import java.io.IOException; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/Servlet") public class Servlet extends HttpServlet { private static final long serialVersionUID = 1L; public Servlet() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { List<bean> list = new ArrayList<bean>(); bean a= new bean(); a.setNumBer("1"); a.setUserName("gyn"); a.setPassWord("123"); list.add(a); request.getSession().setAttribute("users", list); request.getRequestDispatcher("/users.jsp").forward(request, response); } public void doPost(HttpServletRequest req,HttpServletResponse resp) throws ServletException,IOException{ this.doGet(req,resp) ; } } ``` bean.java ``` package cuit; public class bean implements java.io.Serializable { private static final long serialVersionUID = 1L; private String numBer ; private String userName; private String passWord ; public String getNumBer() { return numBer; } public void setNumBer(String numBer) { this.numBer = numBer; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getPassWord() { return passWord; } public void setPassWord(String passWord) { this.passWord = passWord; } } ``` users.jsp ``` <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@page contentType="text/html;charset=gbk" %> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <title>首页</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <link href="css/bootstrap.min.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link href="css/main1.css" rel="stylesheet"> </head> <body> <!-- Wrap all page content here --> <div id="wrap"> <!-- Fixed navbar --> <!-- 导航栏 开始--> <div class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Project</a> </div> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="#">首页</a></li> <li><a href="admin.jsp">管理页面</a></li> <li><a href="#">退出</a></li> </ul> </div><!--/.nav-collapse --> </div> </div> <!-- 导航栏 结束--> <!-- Begin page content --> <div class="container"> <div class="page-header"> <h1>用户列表</h1> </div> <div class="table-responsive"> <table class="table table-striped"> <thead> <tr> <th>序号</th> <th>用户名</th> <th>密码</th> <th>操作</th> </tr> </thead> <tbody> <c:forEach var="a" items="${users} "> <tr> <td>${a.numBer }</td> <td>${a.userName }</td> <td>${a.passWord }</td> <td><a href="#">编辑</a>&nbsp;&nbsp;<a href="#">删除</a></td> </tr> </c:forEach> </tbody> </table> </div> </div> </div> <div id="footer"> <div class="container"> <p class="text-muted credit">网站访问次数:</p> </div> </div> <!-- script references --> <script type='text/javascript' src="js/jquery-1.9.1.min.js"></script> <script type='text/javascript' src="js/bootstrap.min.js"></script> </body> </html> ``` 在myeclipse上运行时,会报错,错误提示为: Property 'numBer' not found on type java.lang.String 经过数次尝试都没有改对,请问要怎么修改呢?
hibernate 分页查询??
写了一个hibernate分页查询,设置了: query.setFirstResult(first); query.setMaxResults(10); 第一页返回的集合是10条,到后面每翻一页,返回的list集合都是累加10条记录。但是页面上显示的又是正确的,所以很不解???? 下面是jsp上显示的代码: <c:forEach begin="0" end="${pagingUtil.pageSize-1}" items="${list}" var="sks"> <td width="120">${sks.cmdId}</td> <td width="100">${sks.objType}</td> <td width="100">${sks.objName}</td> <td width="380">${sks.cmdFile}</td> <td width="120">${sks.createDate}</td> </c:forEach>
Java新手求助,动态下拉列表
项目用LayUi框架+SpringMvc实现的 点击总体页面右侧的编辑按钮弹出Layui渲染的窗口(另一个jsp页),窗口中的下拉列表想做成从后端数据库表中查出的数据 ![图片说明](https://img-ask.csdn.net/upload/201706/07/1496817409_419946.png) 整体页: ``` <fieldset class="layui-elem-field"> <legend>诉讼指南列表</legend> <div class="layui-field-box layui-form"> <table class="layui-table admin-table"> <thead> <tr> <th style="width: 30px;"><input type="checkbox" lay-filter="allselector" lay-skin="primary"></th> <th>标题</th> <th>日期</th> <th>分类</th> <th>操作</th> </tr> </thead> <tbody id="content"> </tbody> </table> </div> </fieldset> <div class="admin-table-page"> <div id="paged" class="page"> </div> </div> <script type="text/html" id="tpl"> {{# layui.each(d.list, function(index, item){ }} <tr> <td><input type="checkbox" lay-skin="primary"></td> <td>{{ item.heading }}</td> <td>{{ item.dates }}</td> <td>{{ item.litigationguidesubmenu.litigationguidesubmenuname }}</td> <td> <!-- 修改按钮 --> <a href="javascript:;" data-gid="{{ item.gid }}" data-heading="{{ item.heading }}" data-straightmatter="{{ item.straightmatter }}" data-dates="{{ item.dates }}" data-opt="edit" class="layui-btn layui-btn-mini" id="update" onclick="edit(this)">编辑</a> <a href="javascript:;" data-gid="{{ item.gid }}" data-opt="del" id="del" class="layui-btn layui-btn-danger layui-btn-mini" onclick="del(this)">删除</a> </td> </tr> {{# }); }} </script> <script type="text/javascript" src="${pageContext.request.contextPath }/plugins/layui/layui.js"></script> <script> layui.config({ base: 'js/' }); layui.use(['paging', 'form'], function() { var $ = layui.jquery, paging = layui.paging(), layerTips = parent.layer === undefined ? layui.layer : parent.layer, layer = layui.layer, form = layui.form(); paging.init({ /* 省略查询代码 */ complate: function() { //点击编辑按钮弹出编辑窗口 $.post('view/LitigationGuide/forms/updateForm.jsp',{gid:$(this).data('gid'),heading:$(this).data('heading'),straightmatter:$(this).data('straightmatter'),dates:$(this).data('dates'),submenu:$(this).data('submenu')}, function(form) { addBoxIndex = layer.open({ type: 1, title: '修改诉讼指南', content: form, btn: ['保存', '取消'], shade: false, offset: ['100px', '30%'], area: ['800px', '620px'], zIndex: 19950924, maxmin: true, yes: function(index) { //触发表单的提交事件 $('form.layui-form').find('button[lay-filter=edit]').click(); }, success: function(layero, index) { //弹出窗口成功后渲染表单 var form = layui.form(); form.render(); form.on('submit(edit)', function(data) { //参数传入controller $.post('litigationguide/updateLitigationGuide.json',data.field,function(res){ location.reload(); }); return false; }); }, end: function() { addBoxIndex = -1; } }); }); }); }); }, }); </script> ``` updateForm.jsp: ``` <html> ... <body> <!--省略标题、正文、日期等...--> <div class="layui-form-item" style="width:200px; margin-left:110px;"> <select name="fenlei" lay-verify="" > <option value="">请选择文章分类</option> <c:forEach items="${ 后台返回的集合 }" var="s"> <option value="${ s.id }">${ s.值 }</option> </c:forEach> </select> </div> ... </body> ... </html> ``` 小白还求高手指教
jqgrid获取不到后台数据,大神帮忙看一下
下面是 页面部分: ``` <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=urf-8"> <title>调度任务列表</title> <style type="text/css">@import url('${pageContext.request.contextPath}/styles/home.css'); .selected{ background:#F0F0F0;} @import url('${pageContext.request.contextPath}/css/jquery-ui-1.8.4.custom.css'); @import url('${pageContext.request.contextPath}/css/ui.jqgrid.css'); </style> <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-migrate-1.2.1.js"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/js/grid.locale-zh_CN.js"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.jqGrid.min.js"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/js/grid.custom.js"></script> <%-- <script type="text/javascript" src="${pageContext.request.contextPath}/js/common/triggerList.js"></script> --%> <script type="text/javascript"> $(function() { $("#tableList").jqGrid({ url : "${pageContext.request.contextPath}/JobProcessServlet?jobtype=100&action=query", // 提交的action地址 rownumbers : true, // 是否显示前面的行号 datatype : "json", // 返回的数据类型 mtype : "post", // 提交方式 height : "auto", // 表格宽度 autowidth : true, // 是否自动调整宽度 colNames:['Trigger 名称','Trigger 分组','下次执行时间','上次执行时间','优先级','Trigger 状态','Trigger 类型','开始时间','结束时间','操作'], colModel : [ { name : "display_name", index : "display_name", width : 60, sortable : true, align : 'center' }, { name : "trigger_group", index : "trigger_group", width : 60, sortable : true, align : 'center' }, { name : "next_fire_time", index : "next_fire_time", width : 60, sortable : true, align : 'center' }, { name : "prev_fire_time", index : "prev_fire_time", width : 60, sortable : true, align : 'center', }, { name : "priority", index : "priority", width : 60, sortable : true, align : 'center' }, { name : "statu", index : "statu", width : 60, sortable : true, align : 'center' }, { name : "trigger_type", index : "trigger_type", width : 60, sortable : true, align : 'center' }, { name : "start_time", index : "start_time", width : 60, sortable : true, align : 'center' }, { name : "end_time", index : "end_time", width : 60, sortable : true, hidden : true, align : 'center' } , { name : "process", index : "process", sortable : true, hidden : true, align : 'center' }], gridComplete : function() { $("#_empty", "#tableList") .addClass("nodrag nodrop"); $("#tableList").tableDnDUpdate(); var ids = jQuery("#tableList").jqGrid('getDataIDs'); for ( var i = 0; i < ids.length; i++) { var cl = ids[i]; update = "<input type='button' id='update' value='修改作业表达式' onclick='update(" + cl + ")'/>&nbsp;"; runOnce = "<input type='button' id='runOnce' value='立即执行一次' onclick='runOnce(" + cl + ")'/>&nbsp;"; pause = "<input type='button' id='runOnce' value='暂停' onclick='doCmd(" + cl + ")'/>&nbsp;"; recolve = "<input type='button' id='runOnce' value='恢复' onclick='doCmd(" + cl + ")'/>&nbsp;"; del = "<input type='button' id='runOnce' value='删除' onclick='doCmd(" + cl + ")'/>&nbsp;"; jQuery("#tableList").jqGrid('setRowData', ids[i], { process : update + runOnce + pause + recolve + del }); } }, viewrecords : true, sortname : "display_name", rowNum : 20, rowList : [10, 15, 20], prmNames : { search : "search" }, jsonReader : { root : "dataList", // 服务端保存数据的集合 repeatitems : false, page: "page", total: "total", records: "records", cell: "dataList", }, pager : "gridPager", hidegrid : false }); }); </script> </head> <body> <br><br> <table align="center" width="1100" border="0"> <tr> <td align="left"><a href="${pageContext.request.contextPath}/addTrigger.jsp">添加调度任务</a></td> </tr> <tr> <td align="left"><a href="${pageContext.request.contextPath}/logdb">查看作业日志表</a></td> </tr> <tr> <td align="left"><a href="${pageContext.request.contextPath}/compleData.htm">补数</a></td> </tr> </table> <div align="center" style="margin-bottom:5px"> <input type="button" id="update" style="margin-right:10px;" value="修改作业表达式" onclick="update()"> <input type="button" id="runOnce" style="margin-right:10px;" value="立即执行一次" onclick="runOnce()"> <input type="button" id="pause" style="margin-right:10px;" value="暂停" onclick="doCmd('pause')"> <input type="button" id="resume" style="margin-right:10px;" value="恢复" onclick="doCmd('resume')"> <input type="button" id="remove" style="margin-right:10px;" value="删除" onclick="doCmd('remove')"> </div> <table id="tableList"></table> <div id ="gridPager"></div> <%-- <table id="tableList" align="center" width="1100" border="1"> <tr> <th nowrap> 选择 </th> <th nowrap> Trigger 名称 </th> <th nowrap> Trigger 分组 </th> <th nowrap> 下次执行时间 </th> <th nowrap> 上次执行时间 </th> <th nowrap> 优先级 </th> <th nowrap> Trigger 状态 </th> <th nowrap> Trigger 类型 </th> <th nowrap> 开始时间 </th> <th nowrap> 结束时间 </th> <!-- <th nowrap> 动作命令 </th> --> </tr> <c:forEach var="map" items="${list}"> <tr align="center"> <td nowrap> <input type="checkbox" value="${map.trigger_name}"> </td> <td nowrap> ${map.display_name} </td> <td nowrap> ${map.trigger_group} </td> <td nowrap> ${map.next_fire_time} </td> <td nowrap> ${map.prev_fire_time} </td> <td nowrap> ${map.priority} </td> <td nowrap> ${map.statu} </td> <td nowrap> ${map.trigger_type} </td> <td nowrap> ${map.start_time} </td> <td nowrap> ${map.end_time} </td> <td nowrap> <input type="button" id="update" value="修改作业表达式" onclick="update('${map.trigger_name}','${map.job_name}')"> <input type="button" id="runOnce" value="立即执行一次" onclick="runOnce('${map.job_name}')"> <input type="button" id="pause" value="暂停" onclick="doCmd('pause','${map.trigger_name}','${map.trigger_group}','${map.trigger_state}')"> <input type="button" id="resume" value="恢复" onclick="doCmd('resume','${map.trigger_name}','${map.trigger_group}','${map.trigger_state}')"> <input type="button" id="remove" value="删除" onclick="doCmd('remove','${map.trigger_name}','${map.trigger_group}','${map.trigger_state}')"> </td> </tr> </c:forEach> </table> --%> </body> </html> 下面是java部分: private void getQrtzTriggers(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); List<Map<String, Object>> results = this.schedulerService .getQrtzTriggers(); String page = request.getParameter("page"); // 取得当前页数,注意这是jqgrid自身的参数 int rows = 20; int qrtzTriggers = this.schedulerService.countQrtzTriggers(); JSONObject json = new JSONObject(); json.put("dataList", results); json.put("records", qrtzTriggers);//总记录数 json.put("page", page); // 当前页 int total = qrtzTriggers/rows + ((qrtzTriggers%rows)>0?1:0); //计算得出的总页数 json.put("total", total); // 总页数 //System.out.println(rows); response.setCharacterEncoding("utf-8"); PrintWriter out = response.getWriter(); out.write(json.toString()); System.out.println(json.toString()); /*request.setAttribute("list", results);*/ request.getRequestDispatcher("/list.jsp").forward(request, response); } ```
ssm pageheleper 模糊查询语句出错
@RequestMapping("mohu") public String mohuchaxun(@RequestParam(value="pn",defaultValue="1")Integer pn,Model model,books bk){ //从第一条开始 每页查询五条数据 PageHelper.startPage(pn, 3); List<books> users = userService.mohu(bk); System.out.println("测试集合有没有获取到数据"+bk.getBookuser()); System.out.println("大小"+users.size()); //将用户信息放入PageInfo对象里 PageInfo page1 = new PageInfo(users,7); model.addAttribute("pageInfo2", page1); return "mohu"; } -----------------------------------------------------------------controller <select id="mohu" parameterType="books" resultType="books"> select * from books where bookuser LIKE '%' #{bookuser} '%' </select> -------------------------------------------------------------------dao.xml <c:forEach items="${pageInfo2.list }" var="user"> <tr> <td>${user.bid}</td> <td>${user.bookuser }</td> <td>${user.booktype }</td> <td><img src="${user.bookimg}" width="200" height="100" ></td> <!-- <td><img src="${user.bookimg}" width="200" height="300" ></td> --> <!-- <td><a class="edit">编辑</a> <a class="delete">删除</a></td> --> </tr> </c:forEach> </table> </div> </div> <hr style="height:1px;border:none;border-top:1px solid #ccc;" /> <!-- 分页导航栏 --> <!-- 分页信息 --> <div class="row"> <!-- 分页文字信息,其中分页信息都封装在pageInfo中 --> <div class="col-md-6"> 当前第:${pageInfo2.pageNum}页,总共:${pageInfo2.pages}页,总共:${pageInfo2.total}条记录 </div> <!-- 分页条 --> <div class="col-md-6"> <nav aria-label="Page navigation"> <ul class="hvtulli" style="list-style-type:none"> <li><a href="${path}/user/mohu?pn=1">首页</a></li> <c:if test="${pageInfo2.hasPreviousPage }"> <li> <a href="${path}/user/mohu?pn=${pageInfo2.pageNum-1}" aria-label="Previous"> <span aria-hidden="true">上一页</span> </a> </li> </c:if> <c:forEach items="${pageInfo2.navigatepageNums }" var="page_Num"> <c:if test="${page_Num == pageInfo2.pageNum }"> <li class="active"><a href="#">${ page_Num}</a></li> </c:if> <c:if test="${page_Num != pageInfo2.pageNum }"> <li><a href="${path}/user/mohu?pn=${ page_Num}">${ page_Num}</a></li> </c:if> </c:forEach> <c:if test="${pageInfo2.hasNextPage }"><a href="${path}/user/mohu?pn=${pageInfo2.pageNum+1}" aria-label="Next">下一页 </a> </c:if> <a href="${path}/user/mohu?pn=${pageInfo2.pages}">末页</a> -----------------------------------------------------------jsp 普通的查询这样都可以做到。 但是这个模糊查询,点击首页或者末页就会报错, Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null '%') tmp_count' at line 2 ### The error may exist in com/ssm/dao/Userdao.xml ### The error may involve com.ssm.dao.Userdao.mohu-Inline ### The error occurred while setting parameters ### SQL: select count(0) from (select * from books where bookuser LIKE '%' ? '%') tmp_count 知道是sql的错误, 请大神帮我看看怎么办。 我是初学者。
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
死磕YOLO系列,YOLOv1 的大脑、躯干和手脚
YOLO 是我非常喜欢的目标检测算法,堪称工业级的目标检测,能够达到实时的要求,它帮我解决了许多实际问题。 这就是 YOLO 的目标检测效果。它定位了图像中物体的位置,当然,也能预测物体的类别。 之前我有写博文介绍过它,但是每次重新读它的论文,我都有新的收获,为此我准备写一个系列的文章来详尽分析它。这是第一篇,从它的起始 YOLOv1 讲起。 YOLOv1 的论文地址:https://www.c...
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的回答,对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalking,作者吴晟、刘浩杨 等等 仓库地址: apache/skywalking 更...
20行Python代码爬取王者荣耀全英雄皮肤
引言 王者荣耀大家都玩过吧,没玩过的也应该听说过,作为时下最火的手机MOBA游戏,咳咳,好像跑题了。我们今天的重点是爬取王者荣耀所有英雄的所有皮肤,而且仅仅使用20行Python代码即可完成。 准备工作 爬取皮肤本身并不难,难点在于分析,我们首先得得到皮肤图片的url地址,话不多说,我们马上来到王者荣耀的官网: 我们点击英雄资料,然后随意地选择一位英雄,接着F12打开调试台,找到英雄原皮肤的图片...
简明易理解的@SpringBootApplication注解源码解析(包含面试提问)
欢迎关注文章系列 ,关注我 《提升能力,涨薪可待》 《面试知识,工作可待》 《实战演练,拒绝996》 欢迎关注我博客,原创技术文章第一时间推出 也欢迎关注公 众 号【Ccww笔记】,同时推出 如果此文对你有帮助、喜欢的话,那就点个赞呗,点个关注呗! 《提升能力,涨薪可待篇》- @SpringBootApplication注解源码解析 一、@SpringBootApplication 的作用是什...
西游记团队中如果需要裁掉一个人,会先裁掉谁?
2019年互联网寒冬,大批企业开始裁员,下图是网上流传的一张截图: 裁员不可避免,那如何才能做到不管大环境如何变化,自身不受影响呢? 我们先来看一个有意思的故事,如果西游记取经团队需要裁员一名,会裁掉谁呢,为什么? 西游记团队组成: 1.唐僧 作为团队teamleader,有很坚韧的品性和极高的原则性,不达目的不罢休,遇到任何问题,都没有退缩过,又很得上司支持和赏识(直接得到唐太宗的任命,既给袈...
Python语言高频重点汇总
Python语言高频重点汇总 GitHub面试宝典仓库 回到首页 目录: Python语言高频重点汇总 目录: 1. 函数-传参 2. 元类 3. @staticmethod和@classmethod两个装饰器 4. 类属性和实例属性 5. Python的自省 6. 列表、集合、字典推导式 7. Python中单下划线和双下划线 8. 格式化字符串中的%和format 9. 迭代器和生成器 10...
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外
ES6基础-ES6的扩展
进行对字符串扩展,正则扩展,数值扩展,函数扩展,对象扩展,数组扩展。 开发环境准备: 编辑器(VS Code, Atom,Sublime)或者IDE(Webstorm) 浏览器最新的Chrome 字符串的扩展: 模板字符串,部分新的方法,新的unicode表示和遍历方法: 部分新的字符串方法 padStart,padEnd,repeat,startsWith,endsWith,includes 字...
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来获取数据。 在电脑上安装
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 更多有趣分析教程,扫描下方二维码关注vx公号「裸睡的猪」 即可查看! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布
web前端javascript+jquery知识点总结
Javascript javascript 在前端网页中占有非常重要的地位,可以用于验证表单,制作特效等功能,它是一种描述语言,也是一种基于对象(Object)和事件驱动并具有安全性的脚本语言 ,语法同java类似,是一种解释性语言,边执行边解释。 JavaScript的组成: ECMAScipt 用于描述: 语法,变量和数据类型,运算符,逻辑控制语句,关键字保留字,对象。 浏览器对象模型(Br
Qt实践录:开篇
本系列文章介绍笔者的Qt实践之路。
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。   再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。   下文是原回答,希望能对你能有所启发。   如果我说,这个世界上人真的分三六九等,
为什么听过很多道理,依然过不好这一生?
记录学习笔记是一个重要的习惯,不希望学习过的东西成为过眼云烟。做总结的同时也是一次复盘思考的过程。 本文是根据阅读得到 App上《万维钢·精英日课》部分文章后所做的一点笔记和思考。学习是一个系统的过程,思维模型的建立需要相对完整的学习和思考过程。以下观点是在碎片化阅读后总结的一点心得总结。
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计
一条链接即可让黑客跟踪你的位置! | Seeker工具使用
搬运自:冰崖的部落阁(icecliffsnet) 严正声明:本文仅限于技术讨论,严禁用于其他用途。 请遵守相对应法律规则,禁止用作违法途径,出事后果自负! 上次写的防社工文章里边提到的gps定位信息(如何防止自己被社工或人肉) 除了主动收集他人位置信息以外,我们还可以进行被动收集 (没有技术含量) Seeker作为一款高精度地理位置跟踪工具,同时也是社交工程学(社会工程学)爱好者...
作为程序员的我,大学四年一直自学,全靠这些实用工具和学习网站!
我本人因为高中沉迷于爱情,导致学业荒废,后来高考,毫无疑问进入了一所普普通通的大学,实在惭愧...... 我又是那么好强,现在学历不行,没办法改变的事情了,所以,进入大学开始,我就下定决心,一定要让自己掌握更多的技能,尤其选择了计算机这个行业,一定要多学习技术。 在进入大学学习不久后,我就认清了一个现实:我这个大学的整体教学质量和学习风气,真的一言难尽,懂的人自然知道怎么回事? 怎么办?我该如何更好的提升
前端JS初级面试题二 (。•ˇ‸ˇ•。)老铁们!快来瞧瞧自己都会了么
1. 传统事件绑定和符合W3C标准的事件绑定有什么区别? 传统事件绑定 &lt;div onclick=""&gt;123&lt;/div&gt; div1.onclick = function(){}; &lt;button onmouseover=""&gt;&lt;/button&gt; 注意: 如果给同一个元素绑定了两次或多次相同类型的事件,那么后面的绑定会覆盖前面的绑定 (不支持DOM事...
Python学习笔记(语法篇)
本篇博客大部分内容摘自埃里克·马瑟斯所著的《Python编程:从入门到实战》(入门类书籍),采用举例的方式进行知识点提要 关于Python学习书籍推荐文章 《学习Python必备的8本书》 Python语法特点: 通过缩进进行语句组织 不需要变量或参数的声明 冒号 1 变量和简单数据结构 1.1 变量命名 只能包含字母、数字和下划线,且不能以数字打头。 1.2 字符串 在Python中,用引号...
[Pyhon疫情大数据分析] 一.腾讯实时数据爬取、Matplotlib和Seaborn可视化分析全国各地区、某省各城市、新增趋势
思来想去,虽然很忙,但还是挤时间针对这次肺炎疫情写个Python大数据分析系列博客,包括网络爬虫、可视化分析、GIS地图显示、情感分析、舆情分析、主题挖掘、威胁情报溯源、知识图谱、预测预警及AI和NLP应用等。第一篇文章将分享腾讯疫情实时数据抓取,获取全国各地和贵州省各地区的实时数据,并将数据存储至本地,最后调用Maplotlib和Seaborn绘制中国各地区、贵州省各城市、新增人数的图形。希望这篇可视化分析文章对您有所帮助!
相关热词 c#导入fbx c#中屏蔽键盘某个键 c#正态概率密度 c#和数据库登陆界面设计 c# 高斯消去法 c# codedom c#读取cad文件文本 c# 控制全局鼠标移动 c# temp 目录 bytes初始化 c#
立即提问