SSM整合实例--(二)PageHelper分页操作

mybatis的分页插件+ssm整合 介绍 分页是我们开发项目时经常使用到的一个功能,它的好处是页面美观,提高查询效率,并不是直接将所有的数据都查出,而是只查询必须的数据。 我们开发项目时一般都会使用比较方便的工具,myBatis有一个分页工具叫pageHelper,这个插件其实就是对之前大家写的那个分页逻辑的封装,使用起来更加简单,实现方式都是一样。这个插件是国内一个大牛写的现在在github上维护 下载地址 https://git... 阅读详情

一、PageHelper分页简介

MyBatis 分页插件 PageHelper,如果你也在用
MyBatis,建议尝试该分页插件,这一定是最方便使用的分页插件。分页插件支持任何复杂的单表、多表分页。

摘自官网,听说是最方便的分页插件。

二、PageHelper使用

2.1 导入jar包

使用maven的直接添加依赖就好了,这次没有使用maven,导入以下两个jar包。

在这里插入图片描述
2.2 页面搭建

(一)中使用了很简单的JSP页面,这次使用easyui来做分页页面。需先导入easyui的js和css文件,导入后目录如下。

jsp中放本次所使用的的文件,list为(一)的简单页面。index.jsp为此次简单的主页,product_list.jsp为本次easyui的商品列表页。

在这里插入图片描述
index.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>首页</h1>

	<a href="${pageContext.request.contextPath }/getProductList">商品列表</a>

</body>
</html>

product_list.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
	<!-- 引入easyUI的CSS和JS -->
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/themes/icon.css">
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/locale/easyui-lang-zh_TW.js"></script>
</head>
<script type="text/javascript">
	$(function(){
	//	alert(1);
		$('#dg').datagrid({    
			url:'${pageContext.request.contextPath }/productList',    
			columns:[[    
				{field:'pName',title:'商品名称',width:160,sortable:true},    
				{field:'pPrice',title:'商品单价',width:160,sortable:true},    
				{field:'xxx',title:'操作',width:180,align:'center',formatter: function(value,row,index){
					return "<a href='#'>修改</a> | <a href='#'>删除</a>";
					}
				}
			]], 
			//显示斑马线
			striped:true,
			//显示分页工具条
			pagination:true,
			//自定义pagesize
			pageList:[3,5,10],
			pageSize:5
		});  
	});
</script>
	
	<body>
		<h1>商品管理页面</h1>
		<table id="dg" style="width:500px;"></table>
	</body>
</html>

页面效果:

在这里插入图片描述
在这里插入图片描述
字体引错了,引用了台湾的繁体,图已经截完了,懒得改了。easyui-lang-zh_TW.js换成easyui-lang-zh_CN.js就好了。

2.3 后台代码

结构如下
在这里插入图片描述
EasyUIDateGridResult.java

package com.cf.common.pojo;

import java.util.List;

/**
 * datagrid展示数据的pojo类
 * 
 * @author cf
 *
 */
public class EasyUIDateGridResult {
	private Integer total;

	private List<?> rows;

	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	public List<?> getRows() {
		return rows;
	}

	public void setRows(List<?> rows) {
		this.rows = rows;
	}

}

ProductService.java

新增以下方法

//easy UI的方式返回数据
public EasyUIDateGridResult getProductList(Integer page, Integer rows);

ProductServiceImpl.java

新增以下方法:

/**
 * 根据当前页面和行数实现分页
 */
@Override
public EasyUIDateGridResult getProductList(Integer page, Integer rows) {
	//使用pageHelper设置分页信息
	if(null == page) page = 1;
	if(null == rows) rows = 5;
	PageHelper.startPage(page, rows);
	//设置example对象,查询所有list
	TbProductExample example = new TbProductExample();
	List<TbProduct> list = mapper.selectByExample(example);
	//获取分页信息
	PageInfo<TbProduct> info = new PageInfo<>(list);
	//分装到EasyUIDateGridResult
	EasyUIDateGridResult result = new EasyUIDateGridResult();
	//设置总纪录数
	result.setTotal((int)info.getTotal());
	//设置list
	result.setRows(info.getList());
	
	return result;
}

PageController.java

导向今天刚写的jsp页面

package com.cf.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cf.common.pojo.EasyUIDateGridResult;
import com.cf.pojo.TbProduct;
import com.cf.service.ProductService;

@Controller

public class PageController {

	@Autowired
	private ProductService productService;
	
	//导向主页
	@RequestMapping("/")
	public String index() {
		return "index";
	}
	
	//导向商品页面
	@RequestMapping("/getProductList")
	public String getProductList() {
		return "product_list";
	}
	
	//无分页的简单jsp商品页面
	@RequestMapping("/list")
	public String list(Model model) {
		List<TbProduct> list = productService.list();
		model.addAttribute("list", list);
		return "list";
	}
	
	//带分页的JSP页面
	@RequestMapping("/productList")
	@ResponseBody
	public EasyUIDateGridResult getProductList(Integer page, Integer rows) {
		EasyUIDateGridResult result = productService.getProductList(page, rows);
		return result;
	}
}

springmvc.xml

配置中增加以下配置语句,放行静态资源。

	<mvc:resources location="/WEB-INF/css/" mapping="/css/**"/>
	<mvc:resources location="/WEB-INF/js/" mapping="/js/**"/>
	<mvc:resources location="/WEB-INF/locale/" mapping="/locale/**"/>
	<mvc:resources location="/WEB-INF/plugins/" mapping="/plugins/**"/>
	<mvc:resources location="/WEB-INF/themes/" mapping="/themes/**"/>

因为web.xml配置 / 的路径,所有访问全部拦截,所有静态资源也被拦截,但是不包括jsp页面。使用以上配置进行放行。

如果jsp页面有的静态资源被放行有的没有,路径也正确,注意下引入的先后顺序,让jquery先引入
在这里插入图片描述
2.4 PageHelper的配置

pagehelper也需要配置,否则查询出来是没有分页效果的。如果页面及分页工具栏均正常展示,但是数据没有被分页。需查看此配置是否正确。

applicationContext-dao.xml

在sqlSessionFactoryBean的bean中添加PageHelper的配置

<!-- 配置sqlsessionfactory -->
<bean id="sqlSessionFactoryBean" class="org.mybatis.spring.SqlSessionFactoryBean">
	<!-- 设置MyBatis核心配置文件 -->
	<property name="configLocation" value="classpath:mybatis/SqlMapConfig.xml"/>
	<!-- 配置数据源 -->
	<property name="dataSource" ref="dataSource"></property>
	 
	<!-- 配置mybatis分页插件PageHelper -->
	<property name="plugins">
		<array>
			<bean class="com.github.pagehelper.PageInterceptor">
				<property name="properties">
					<!-- 什么都不配,使用默认的配置 -->
					<value></value>
				</property>
			</bean>
		</array>
	</property>
</bean>

三、页面效果

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
以上是使用PageHelper进行分页。easyui接受的分页json数据是固定格式,详细可以去看easyui的教程。后面慢慢更新CRUD操作

【SpringMVC 】什么是SpringMVC(二)?如何整合ssm框架以及使用mybatisPlus? MybatisPlus的基础操作封装了常见的增删改查操作,使得开发者可以更容易地使用MybatisPlus进行数据库操作。这些基础操作是通过Mapper接口和实现类来完成的,开发者只需要继承BaseMapper接口即可。以下是MybatisPlus支持的基础操作: 插入:insert、insertBatch、insertOrUpdate 等方法。 更新:updateById、update、updateBatchById 等方法。 删除:deleteById、deleteByMap、delete 等方法。 阅读详情

相关推荐

SSM+PageHelper实现分页——及解决PageHelper失效问题

PageHelper简述:一款好用的开源免费的Mybatis第三方物理分页插件,用起来非常方便,减少了很多代码量。 官方文档:https://pagehelper.github.io/docs/howtouse/,官方文档是最靠谱的,多看几眼,少踩几个坑! 一.SSM项目整合PageHelper 1.添加坐标或者导入jar包 <dependency> <groupId>com.github.pagehelper</groupId> <artifact

lst991120的博客 2666

分页插件PageHelper实例

【代码】分页插件PageHelper实例。

mingzq123的博客 223

ssm中使用myBatis分页插件pageHelper:进行分页查询

分页查询是开发项目时必不可少的,这里给大家介绍一个myBatis中的分页插件:pageHelper,使用分页插件可以方便并且快速的实现分页查询。

qq_44775798的博客 2667

PageHelper 分页的实例

后端代码 //做一个显示全部的 @RequestMapping("/goto_shopkeeperJSP") public String goto_shopkeeperJSP(@RequestParam(value = "pn", required = false, defaultValue = "1")Integer pn , Model model){ //暂时不做商家登录界面 //这个一定要先写在查询前面,一般是这样 PageHelper.startPage(pn,5); Li

qq_42331499的博客 515

SSM框架整合与Mybatis-PageHelper分页功能实践

本文还有配套的精品资源,点击获取 简介:本文介绍了在企业级Web开发中广泛使用的Spring、SpringMVC和MyBatis框架的整合过程。通过详细步骤指导如何配置这三个框架,并利用MyBatis-PageHelper插件实现分页功能。整合后的SSM框架能够简化Java应用开发,提供灵活高效的数据访问,便于开发者快速搭建具备分页功能的Web项目。 1. Spr...

weixin_35391606的博客 936

汽车OTA安全启动:ECU双验签机制与实战排障指南

汽车OTA升级中的安全启动,本质是基于密码学的信任建立过程,其核心在于ECU上电时对固件镜像的可信验证。该机制依托硬件信任根(Secure Boot ROM),通过RSA/ECDSA等非对称算法完成签名验签,确保升级包未被篡改且来源可信。技术价值体现在防止恶意固件注入、支撑功能安全(ASIL)与信息安全(ISO/SAE 21434)合规。典型应用场景包括4S店远程升级、BMS控制器固件更新及多ECU协同启动。实践中,验签名失败往往源于证书链断裂、Flash布局错位或KeyUsage字段不匹配等底层工程细节,

weixin_29314405的博客 76

SSM+PageHelper实现分页查询

SSM+PageHelper实现分页查询

程序员阿文 1301

AI 大模型在电商精准营销中的应用

例如,对于用户 A 和用户 B,通过比较他们对共同评价过的商品的评分差异来确定相似度。其中,(Gain(D,a))表示特征(a)对数据集(D)的信息增益,(Ent(D))表示数据集(D)的信息熵,(V)表示特征(a)的取值个数,(D^{v})表示特征(a)取值为(v)的样本子集。其中,(sim(A,B))表示用户 A 和用户 B 的相似度,(I)表示用户 A 和用户 B 共同评价过的商品集合,(R_{A,i})和(R_{B,i})分别表示用户 A 和用户 B 对商品(i)的评分。(三)营销活动效果预测。

alittlehippo的博客 1627

ssm 使用PageHelper 实现分页查询,前台是easyui

service 层代码如下 @Override public void pageQuery(PageBean pageBean,Staff staff) { StaffExample staffExample = new StaffExample(); Criteria createCriteria = staffExample.createCriteria(); //这个分页...

qq_37611061的博客 770

一文读懂AI大模型时代的RAG技术

RAG(Retrieval-Augmented Generation,检索增强生成) 是一种结合检索技术与生成模型的技术架构,旨在通过动态引入外部知识库增强大语言模型(LLM)的生成能力。其核心思想是通过检索系统从外部数据源(如企业知识库、实时文档等)获取相关信息,并将检索结果作为上下文输入生成模型,以提高生成答案的准确性、时效性和专业性

awei0916的专栏 2118

商品评论中的实体情感分析

在之前的文章中我已经将商品评论中的评价实体,也就是特征(feature)给挖掘出来了,我看了一下,挖掘的效果还是不错的。原文链接:http://blog.youkuaiyun.com/chixujohnny/article/details/52794685 下面一步要做的是施加情感因子,也就是说,要将人们评论时候所连带的感情程度施加一下。这项任务的归类应该是情感分析技术。 目前该类问题的情感分析技

chixujohnny 7971

SSM 整合 分页插件 PageHelper

一、简介 现在开发做常用的ORM框架就是MyBatis了,在实际开发中少不了做分页处理,这里提供最常用的分页插件PageHelper PageHelper官网:https://pagehelper.github.io/ 二、使用篇 【springboot2.0 + PageHelper】 注意: springboot2.0 集成时要使用1.2.x以后版本 1、maven依赖 https://mv...

日拱一卒 4768

SAP SD模块定价过程后台配置简介

只有手工输入定价时(例如,在定价中的定价浏览屏幕中),或者只有从外部处理转移这些定价时(例如,成本核算),才将这些定价包括在确定(价格确定、输出确定,批次确定)之中。定价过程的定义和分配是SD模块中最核心的配置,包含了条件表、条件类型、存取顺序、发票类型、客户定价过程等,确定了销售订单已什么价格销售、税率、附加折扣等多个条件行程有一个定价过程。12、小计:记录该条件类型在VBAP表中是否存储,以及其后续用途,如记入信贷,占用信贷额度,记入成本等,如果需要金额暂用信贷额度的话,在小计这里选择A即可。

我小时候很黑的博客 3781

【SSM进阶学习】详解SSM框架中的整合与分页

定义db.properties数据库配置文件针对分页,使用的是PageHelper分页插件,版本使用的是5.1.8。参考文档PageHelper是适用于MyBatis框架的一个分页插件,它支持基本主流与常用的数据库,如MySQL、Oracle、MariaDB、SQLite、Hsqldb等。特性简单易用: PageHelper 提供了简单的配置方式,可以轻松地在 MyBatis 中启用分页功能。

陈橘又青的博客 2万+

【Claude】Extra inputs are not permitted 错误:代理剥离 Beta 标头的解决方案 bug报错已解决

深入分析Claude Code Extra inputs are not permitted 400错误的技术原理,解析代理剥离Beta标头的根因与多种修复方案。

一键难忘的博客 145

网页内容抓取的艺术:使用R语言解析动态网页

本文探讨了使用R语言处理动态网页数据的方法。针对AJAX加载的学术网站,传统的静态抓取和RSelenium方法存在会话终止、浏览器错误等问题。通过分析发现内容通过admin-ajax.php加载,提出使用httr2模拟POST请求获取数据,配合rvest解析HTML内容。该方法避免了浏览器自动化的弊端,实现了高效稳定的动态内容提取,为处理类似AJAX网站提供了通用解决方案。

m0_74337424的博客 52

[PageHelper]-->SSM分页操作的实现

利用pageHelper插件在SSM框架中实现分页操作,同时这个插件应用很方便,理解其各个参数内涵,在SpringBoot中也很好应用

nisinoya的博客 2528

为什么devc++编译项目会失败?提示gcc无法正常启动...

根据你的描述,编译能正常进行时,只打开源文件并没有问题,问题主要出现在创建项目后编译失败,这通常与 Makefile 配置、环境变量、编译器路径设置等因素有关。你可以检查 Makefile 配置,验证 DevC++ 的编译器环境设置,或者尝试清理并重新配置项目。如果问题仍然存在,可以尝试重装 DevC++ 或重新配置工具链。希望如上措施及解决方案能够帮到有需要的你。

**My Coding Family** 1375

分页插件 - PageHelper的介绍和使用

PageHelper介绍 PageHelper是国内非常优秀的一款开源的mybatis分页插件,它支持基本主流与常用的数据库,例如mysql、 oracle、mariaDB、DB2、SQLite、Hsqldb等。 PageHelper使用 引入分页插件有下面两种方式: ① 引入jar包,以下地址可以下载对应jar包 https://oss.sonatype.org/content/repositories/releases/com/github/pagehelper/pagehelper/ 由于使用了sql

qq_44866169的博客 6208

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

SSM中PageHelper实现简单分页

本文在SSM框架下使用pageHelper实现简单分页,关于SSM的部分请参看:SSM+Maven 1.引入Maven依赖 <!-- 分页插件--> <dependency> <groupId>com.github.pagehelper</groupId> <artifactI...

u014141841的博客 1249

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

SSM框架整合PageHelper实现分页功能

前言 ssm框架整合请看我的博客,超级详细哦 然后附上源码链接 整合PageHelper实现分页功能 1.导入Mybatis分页插件依赖 <!--Mybatis 分页插件--> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> <version>5.2.

weixin_51542566的博客 898

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

SSM框架中使用pageHelper插件实现分页查询

在SSM框架的项目中使用pageHelper插件实现分页查询 在项目的pom.xml中添加pagehelper安装依赖 <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifact...

qq_41379337的博客 5789

mybatis分页插件PageHelper的使用(ssm整合pagehelper)

mybatis分页插件的使用 1.回去mysql和oracle分页的区别 mysql分页语句 select * from table_name limit M,N 说明: (1)mysql的M,N只能数字,不能有括号和运算符,否则报错 (2)M,N表示第M条记录开始检索N条记录 oracle分页语句 select * from( SELECT A.*, ROWNUM RN FROM ( SELECT * FROM DEMO ) A WHERE ROWNUM &l

java技术博客 1206

ssm使用pageHelper进行分页

ssm如何使用pagehelper进行分页 最近在写ssm分页的时候遇到了一些麻烦,在此记录一下,顺便总结一下ssm使用pageHelper的过程。 1.首先在配置文件中引入依赖 <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId>

weixin_44357646的博客 1222

尚硅谷ssm整合实战项目笔记

前言 该笔记为尚硅谷SSM实战演练丨ssm整合快速开发CRUD学习笔记 github项目地址:https://github.com/xjhqre/sgg-ssm-demo 一、SSM整合 1、项目介绍 使用SSM框架搭建出一套简单的CRUD项目示例,包括分页查询、Ajax请求、数据校验等。 2、功能点 分页查询 数据校验:JQuery前端校验+JSR-303后端校验 Ajax请求 REST风格的URI:GET查询、POST新增、DELETE删除、PUT修改 3、技术点 基础框架-SSM(Sprin

xjhqre的博客 9083

【SSM】手动SQL分页和PageHelper插件分页

书接上回: 【SSM】SSM整合与运行流程 上文实际上是做了一个CRUD中的查询操作,将数据库中的数据全部显示在网页上。 1 手动SQL分页 即在SQL语句中加上limit关键词,获取分页的数据 1.1 准备分页工具Page类 Page.java package util; public class Page { // start为一个页面起始下标,第一页中第一条记录的下标为0 int start = 0; // count为一个的记录数 int count = 5;

Awt_FuDongLai的博客 3579
上一篇: SSM整合实例--(一)项目搭建
下一篇: SSM整合实例--(三)CRUD操作
Double____C
博客等级 码龄8年 92粉丝 79原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值