1.安装Jenkins1.1 下载rpm包(rpm包网址)sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo1.2 导出密钥若之前已从Jenkins导入过密钥, "rpm--import" 将失败, 请忽略, 继续执行1.3) sudo r...
安装两个依赖npm install --save xlsx file-saver2.给需要导出的表格添加id="out-table"3.组件里头引入插件import FileSaver from "file-saver"; import XLSX from "xlsx";4.编写导出方法 /** 导出为Excel */ ...
格式化日期查询String.format("%02d", day)如果day = 3那么输出的是03如果是day = 13那么输出的是13
步骤导入SpringTest模块@ContextConfiguration注解指定Spring配置文件的位置 自动创建IOC容器@RunWith指定spring单元测试模块直接使用@Autowired或@Resource注解注入需要测试的组件1.1 导入Spring-test jar包下载地址: https://mvnrepository.com/artifact/org.springfra...
错误原因我定义的常量值有问题public static final String applicationContextPath = "classpath:config/spring/applicationContext.xml";由于我的项目源文件不止一个src 我还是用了单独的config导致程序找不到我的applicationContext.xml classpat...
@Repository(value="userDao")该注解是告诉Spring,让Spring创建一个名字叫“userDao”的UserDaoImpl实例。当Service需要使用Spring创建的名字叫“userDao”的UserDaoImpl实例时,就可以使用@Resource(name = "userDao")注解告诉Spring,Spring把创建好的userDao注入给Servi...
依赖注入(Dependency Injection,DI)和控制反转含义相同,它们是从两个角度描述的同一个概念。当某个 Java 实例需要另一个 Java 实例时,传统的方法是由调用者创建被调用者的实例(例如,使用 new 关键字获得被调用者实例),而使用 Spring 框架后,被调用者的实例不再由调用者创建,而是由 Spring 容器创建,这称为控制反转。Spring 容器在创建被调用者的...
浅谈IOCIOC(inversion of control)是Spring的核心,贯穿始终。所谓IOC就是有Spring来控制对象的生命周期和对象间的关系。传统开发模式:对象之间相互依赖IOC开发模式:IOC控制对象之间的依赖1.下载和导入jar包2.书写配置文件Xml文件名字与位置任意,建议放到src目录下起名为applicationContext.xmlpublic class Prod...
1、作用:@RequestParam:将请求参数绑定到你控制器的方法参数上(是springmvc中接收普通参数的注解)2、语法:语法:@RequestParam(value=”参数名”,required=”true/false”,defaultValue=””) value:参数名 required:是否包含该参数,默认为true,表示该请求路径中必须包含该参数,如果不包含就报错。 defa...
@PathVariable注解的作用**映射URL绑定的占位符@PathVariable 注解可以将 URL 中占位符参数绑定到控制器处理方法的入参中;URL 中的 {xxx} 占位符可以通过@PathVariable(“xxx“) 绑定到操作方法的入参中。Demo: /** * 用户注册 根据code获取sessionKey和OpenId并保存; 向客户端推送注册欢迎的we...