4.0.0org.springframework.bootspring-boot-starter-parent2.1.3.RELEASEcom.mrfather0.0.1-SNAPSHOTpomfatherDemo project for Spring Boot1.8entitydaoserviceweborg.springframework.bootspring-boot-starterorg.springframework.bootspring-boot-starter-testtestorg.apache.maven.pluginsmaven-compiler-plugin3.1${java.version}${java.version}org.apache.maven.pluginsmaven-surefire-plugin2.19.1true
4.0.0org.springframework.bootspring-boot-starter-parent2.1.3.RELEASEcom.mrentity0.0.1-SNAPSHOTentityDemo project for Spring Boot1.8org.springframework.bootspring-boot-starterorg.springframework.bootspring-boot-starter-testtest
dao 的 pom.xml 内容
4.0.0org.springframework.bootspring-boot-starter-parent2.1.3.RELEASEcom.mrdao0.0.1-SNAPSHOTdaoDemo project for Spring Boot1.8org.mybatis.spring.bootmybatis-spring-boot-starter2.0.0mysqlmysql-connector-javaruntimeorg.springframework.bootspring-boot-starter-testtestcom.mrentity0.0.1-SNAPSHOT
service 模块的 pom.xml 内容
4.0.0org.springframework.bootspring-boot-starter-parent2.1.3.RELEASEcom.mrservice0.0.1-SNAPSHOTserviceDemo project for Spring Boot1.8org.springframework.bootspring-boot-starterorg.springframework.bootspring-boot-starter-testtestcom.mrdao0.0.1-SNAPSHOTcom.mrentity0.0.1-SNAPSHOT
web模块的 pom.xml 内容
注意build部分,因为web模块作为程序的入口启动,所以它需要打包,并且要指定Main Class
4.0.0org.springframework.bootspring-boot-starter-parent2.1.3.RELEASEcom.mrweb0.0.1-SNAPSHOTwebDemo project for Spring Boot1.8org.springframework.bootspring-boot-starter-weborg.mybatis.spring.bootmybatis-spring-boot-starter2.0.0mysqlmysql-connector-javaruntimeorg.springframework.bootspring-boot-starter-testtestcom.mrdao0.0.1-SNAPSHOTcom.mrentity0.0.1-SNAPSHOTcom.mrservice0.0.1-SNAPSHOTorg.springframework.bootspring-boot-maven-plugincom.mr.WebApplicationZIPrepackage
@Service("userService")
public class UserServiceImpl implements UserService {
@Autowired
private UserDao userDao;
@Override
public List queryService() {
return userDao.queryUser();
}
}
在 web 模块下 com.mr包下创建对应的 UserController 代码如下
@Controller
public class UserController {
@Autowired
private UserService userService;
@RequestMapping("queryUser")
public String queryUser(ModelMap map){
List list= userService.queryService();
map.put("list",list);
return "list";
}
}
本篇文章重点说明什么是函数柯里化,这个语法现象的背后动机是什么,有什么样的应用场景,以及与部分应用函数(Partial Applied Function)之间的联系 1. 什么是柯里化函数
A way to write functions with multiple parameter lists. For instance
def f(x: Int)(y: Int) is a
ApplicationContext能读取多个Bean定义文件,方法是:
ApplicationContext appContext = new ClassPathXmlApplicationContext(
new String[]{“bean-config1.xml”,“bean-config2.xml”,“bean-config3.xml”,“bean-config4.xml
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information re
参考了
http://zhedahht.blog.163.com/blog/static/25411174201142733927831/
但是用java来实现有一个问题。
由于Java无法像C那样“传递参数的地址,函数返回时能得到参数的值”,唯有新建一个辅助类:AuxClass
import ljn.help.*;
public class BalancedBTree {
BeanUtils.copyProperties VS PropertyUtils.copyProperties
作为两个bean属性copy的工具类,他们被广泛使用,同时也很容易误用,给人造成困然;比如:昨天发现同事在使用BeanUtils.copyProperties copy有integer类型属性的bean时,没有考虑到会将null转换为0,而后面的业