10 2022 档案

摘要:1.数据验证 日常项目开发中,对于前端提交的表单,后台接口接收到表单数据后,为了程序的严谨性,通常后端会加入 业务参数的合法校验操作来避免程序的非技术性bug,这里对于客户端提交的数据校验 SpringBoot通过spring-boot-starter-validation模块包含了数据校验的工作。 阅读全文
posted @ 2022-10-30 17:13 lwx_R 阅读(113) 评论(0) 推荐(0) 编辑
摘要:1.事务支持 在使用]dbc作为数据库访问技术时,Spring Boot框架定义了基于jdbc的PlatformTransactionManager接口 的实现DataSourceTransactionManager,并在Spring Boot应用启动时自动进行配置。 这里Spring Boot集成 阅读全文
posted @ 2022-10-30 11:54 lwx_R 阅读(36) 评论(0) 推荐(0) 编辑
摘要:1.什么是定时调度 在SpringBoot中有Java自带的java.util.Timer类 SpringBoot自带的Scheduled来实现,Scheduled 在Spring3.X引入,默认SpringBoot自带该功能使用起来也很简单,在启动类级别添加 @EnableScheduling注解 阅读全文
posted @ 2022-10-30 11:11 lwx_R 阅读(34) 评论(0) 推荐(0) 编辑
摘要:1.pom.xml <!-- 单元测试--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> </dependency> 2.目录结构 阅读全文
posted @ 2022-10-27 18:24 lwx_R 阅读(12) 评论(0) 推荐(0) 编辑
摘要:1.什么是EhCache EhCache是一个比较成熟的Java缓存框架,最早从hibernate发展而来,是进程中的缓存系统 它提供了用内存,磁盘文件存储,以及分布式存储方式等多种灵活的cache管理方案,快速简单。 2.注解使用 2.1 @Cacheable 应用到读取数据的方法,即可缓存的方法 阅读全文
posted @ 2022-10-27 18:21 lwx_R 阅读(642) 评论(0) 推荐(0) 编辑
摘要:1.什么是热部署 热部署,就是在应用正在运行的时候升级软件(增加业务/修改bug),却不需要重新启动应用 在项目开发过程中,常常会改动页面数据或者修改数据结构,为了显示改动效果,往往需要重启应用查看改变效果, 其实就是重新编译生成了新的Class文件,这个文件里记录着和代码等对应的各种信息,然后Cl 阅读全文
posted @ 2022-10-26 17:51 lwx_R 阅读(566) 评论(0) 推荐(0) 编辑
摘要:1.pom.xml配置 <!-- mybatis--> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1. 阅读全文
posted @ 2022-10-25 18:10 lwx_R 阅读(17) 评论(0) 推荐(0) 编辑
摘要:swagger2 用来生产Api文档 1.pom.xml配置 <!-- swagger2 Api文档--> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <versio 阅读全文
posted @ 2022-10-25 17:58 lwx_R 阅读(22) 评论(0) 推荐(0) 编辑
摘要:1.打包为Jar 配置操作为clean compile package -Dmaven.test.skip=true debug 操作 在target目录下 2.打包为war包 2.1 pom修改 添加packaging <groupId>org.example</groupId> <artifac 阅读全文
posted @ 2022-10-24 19:59 lwx_R 阅读(39) 评论(0) 推荐(0) 编辑
摘要:1.在ResourceProperties类下 private static final String[] CLASSPATH_RESOURCE_LOCATIONS = new String[]{"classpath:/META-INF/resources/", "classpath:/resour 阅读全文
posted @ 2022-10-24 18:51 lwx_R 阅读(13) 评论(0) 推荐(0) 编辑
摘要:1.在github新建仓库 2.连接 3.删除仓库 setting里面最底下 输入仓库名称(加粗的部分)即可 阅读全文
posted @ 2022-10-22 10:30 lwx_R 阅读(24) 评论(0) 推荐(0) 编辑
摘要:1.单行显示 overflow:hidden; //超出一行文字自动隐藏 text-overflow:ellipsis;//文字隐藏后添加省略号 white-space:nowrap; //强制不换行 2. 多行显示 display: -webkit-box; word-break: break-a 阅读全文
posted @ 2022-10-21 11:13 lwx_R 阅读(109) 评论(0) 推荐(0) 编辑
摘要:1. 全局异常概念 在JavaEE项目的开发中,不管是对底层的数据库操作过程,还是业务层的处理过程,还是控制层的处理过程,都不可避免会遇到各种可预知的、不可预知的异常需要处理。 每个过程都单独处理异常,系统的代码耦合度高,工作量大且不好统一,维护的工作量也很大。 SpringMvc对于异常处理这块提 阅读全文
posted @ 2022-10-21 10:27 lwx_R 阅读(79) 评论(0) 推荐(0) 编辑
摘要:1.下载 下载链接:https://www.postman.com/downloads/ 中文文档:https://postman.org.cn/getting-started/installation-and-updates/ 2.使用 2.1 注册账号 2.2 在WorksSpace中输入链接选 阅读全文
posted @ 2022-10-19 11:52 lwx_R 阅读(14) 评论(0) 推荐(0) 编辑
摘要:1.数据库建立ssm库,建立user表 2.user实体类 public class User { private int id; private String name; private String password; public int getId() { return id; } publ 阅读全文
posted @ 2022-10-19 11:35 lwx_R 阅读(27) 评论(0) 推荐(0) 编辑
摘要:1. pom.xml <dependencies> <!-- junit 测试--> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</s 阅读全文
posted @ 2022-10-19 10:35 lwx_R 阅读(31) 评论(0) 推荐(0) 编辑
摘要:1.Restful风格 模型-视图-控制器(MVC) 是一个众所周知的以设计界面应用程序为基础的设计思想。 Restful风格的API是一种软件架构风格, 设计风格而不是标准,只是提供了一组设计原则和约束条件。 它主要用于客户端和服务器交互类的软件。基于这个风格设计的软件可以更简洁,更有层次,更易于 阅读全文
posted @ 2022-10-17 20:46 lwx_R 阅读(34) 评论(0) 推荐(0) 编辑
摘要:1.文件上传 1.1 pom.xml <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.3.2</version> </dependenc 阅读全文
posted @ 2022-10-15 19:42 lwx_R 阅读(21) 评论(0) 推荐(0) 编辑
摘要:window.location.href = "login.html" 定时效果 3000毫秒 setTimeout(function(){ },3000); 阅读全文
posted @ 2022-10-14 19:48 lwx_R 阅读(18) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <p>this is p</p> <button type="button">click</button> <script type 阅读全文
posted @ 2022-10-14 19:43 lwx_R 阅读(20) 评论(0) 推荐(0) 编辑
摘要:mvc配置文件 1.全部拦截 <!-- 使用bean定义一个Interceptor --> <mvc:interceptors> <!-- 直接定义在根下面的Interceptor拦截所有请求--> <bean class="org.xxx.springmvc.interceptors.inter1 阅读全文
posted @ 2022-10-13 13:02 lwx_R 阅读(43) 评论(0) 推荐(0) 编辑
摘要:@Controller public class ProductController { /** * 用于将Controller方法返回的对象,通过HttpMessageConverter转化为指定格式 * 写入到Response对象的body数据区 */ @RequestMapping("prod 阅读全文
posted @ 2022-10-13 12:52 lwx_R 阅读(12) 评论(0) 推荐(0) 编辑
摘要:@Controller public class ViewController { //页面重定向 @RequestMapping("v1") public String queryView1(){ return "redirect:v1.jsp?a=123"; } //中文乱码 @RequestM 阅读全文
posted @ 2022-10-13 12:51 lwx_R 阅读(20) 评论(0) 推荐(0) 编辑
摘要:public boolean isSymmetric(TreeNode root) { if(root == null){ return true; } return judge(root.left,root.right); } //左节点的left = 右节点的right 左节点的right = 阅读全文
posted @ 2022-10-11 12:24 lwx_R 阅读(14) 评论(0) 推荐(0) 编辑
摘要:public TreeNode mirrorTree(TreeNode root) { if(root == null){ return null; } TreeNode left=mirrorTree(root.left); TreeNode right=mirrorTree(root.right 阅读全文
posted @ 2022-10-11 12:23 lwx_R 阅读(6) 评论(0) 推荐(0) 编辑
摘要:/遍历A树,用每个节点开始与B进行比较 public boolean isSubStructure(TreeNode A, TreeNode B) { return (A != null && B != null) && (recur(A, B) || isSubStructure(A.left, 阅读全文
posted @ 2022-10-11 12:22 lwx_R 阅读(23) 评论(0) 推荐(0) 编辑
摘要:1.ModelAndView @Controller public class HelloController { @RequestMapping("hell")//http://localhost:8080/hell.do public ModelAndView hello(){ ModelAnd 阅读全文
posted @ 2022-10-08 18:09 lwx_R 阅读(13) 评论(0) 推荐(0) 编辑
摘要:1.参数绑定定义 客户端请求的key/value数据 经过参数绑定,将其绑定到Controller的形参上,然后Controller直接使用该形参。 2.默认数据类型 HttpServletRequest HttpServletResponse HttpSession:HttpServletRequ 阅读全文
posted @ 2022-10-08 18:08 lwx_R 阅读(22) 评论(0) 推荐(0) 编辑
摘要:使用@RequestMapping注解 可以在类/方法上加 @Controller @RequestMapping("url")//http://localhost:8080/url/u01.do 类级别 public class UrlController { @RequestMapping("u 阅读全文
posted @ 2022-10-08 18:04 lwx_R 阅读(149) 评论(0) 推荐(0) 编辑
摘要:语法 /^ $/ ^ 开始标记 $ 结束标记 1.普通字符 [abc] 匹配字符串里所有abc [^abc] 匹配字符串除了abc之外的 [A-Z] 匹配A-Z之间的 . 匹配除了\n、\r之外所有 \s\S \s是匹配所有空白符,包括换行,\S 非空白符,不包括换行。 \w 匹配字母、数字、下划线 阅读全文
posted @ 2022-10-08 12:02 lwx_R 阅读(18) 评论(0) 推荐(0) 编辑
摘要:1.渲染层和逻辑层 1.1 通信模型 小程序的运行环境分成渲染层和逻辑层,其中 WXML 模板和 WXSS 样式工作在渲染层,JS 脚本工作在逻辑层。 1.2 数据驱动 WXML结构实际上等价于一棵Dom树,通过一个JS对象也可以来表达Dom树的结构 阅读全文
posted @ 2022-10-06 18:12 lwx_R 阅读(125) 评论(0) 推荐(0) 编辑
摘要:1.小程序生命周期 App.js中 App({ onLaunch() { //生命周期回调——监听小程序初始化。全局只触发一次 }, onShow(){ //生命周期回调——监听小程序启动或切前台。 }, onHide(){ //生命周期回调——监听小程序切后台。 }, onError(msg){ 阅读全文
posted @ 2022-10-06 18:00 lwx_R 阅读(83) 评论(0) 推荐(0) 编辑
摘要:slow 一次走一步,fast 一次走两步。 那么当 fast 到达链表的末尾时,slow 必然位于中间。 ListNode* middleNode(ListNode* head) { ListNode* slow = head; ListNode* fast = head; while (fast 阅读全文
posted @ 2022-10-06 11:59 lwx_R 阅读(17) 评论(0) 推荐(0) 编辑
摘要:ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) { if(l1 == NULL){ if(l2 == NULL){ return NULL; }else{ return l2; } } if(l1 != NULL && l2 == NULL){ 阅读全文
posted @ 2022-10-06 11:47 lwx_R 阅读(7) 评论(0) 推荐(0) 编辑
摘要:ListNode* reverseList(ListNode* head) { ListNode* tail=NULL; ListNode* front=head; ListNode* curr=NULL; //先令curr指向front,front移动下一个,curr的next指向tail实现反转 阅读全文
posted @ 2022-10-06 11:47 lwx_R 阅读(12) 评论(0) 推荐(0) 编辑
摘要:ListNode* getKthFromEnd(ListNode* head, int k) { ListNode* fast=head; ListNode* slow=head; //因为头结点开始 所以要从1开始 for(int i=1;i<k;i++){ fast=fast->next; // 阅读全文
posted @ 2022-10-06 11:45 lwx_R 阅读(11) 评论(0) 推荐(0) 编辑
摘要:ListNode* deleteNode(ListNode* head, int val) { if(head->val == val){ head=head->next; return head; } ListNode* front=head->next; ListNode* tail=head; 阅读全文
posted @ 2022-10-06 11:44 lwx_R 阅读(45) 评论(0) 推荐(0) 编辑
摘要:1.数据绑定 WXML中部分数据来自JS中的data 1.1 js中设置数据 data: { myName:"123", title:"weixin", content:"123000", arr:["str","lwx"],//数组 // 对象 obj:{name:"lwx",age:18}, d 阅读全文
posted @ 2022-10-05 18:31 lwx_R 阅读(67) 评论(0) 推荐(0) 编辑
摘要:1.新建component 2.使用 2.1 在json中加入 "usingComponents": { "comp":"/components/comp/comp" } 2.2 html使用 <comp></comp> 3.自定义属性值 3.1 在自定义组件的js中 /** * 组件的属性列表 * 阅读全文
posted @ 2022-10-04 20:07 lwx_R 阅读(12) 评论(0) 推荐(0) 编辑
摘要:1.bfs没法回溯,会出现应该能到达的位置被访问 2.多起点 struct pp{ int x; int y; int step; int vis[10][10]; }; int dx[4]={0,0,1,-1}; int dy[4]={1,-1,0,0}; int m; int n; int vi 阅读全文
posted @ 2022-10-04 19:32 lwx_R 阅读(30) 评论(0) 推荐(0) 编辑
摘要:由小至大推导公式,从2段开始一直到n段 int cuttingRope(int n) { //dp[i-j]*j 分为多段 //i-j *j 分为俩端 int dp[n+1]; memset(dp,0,sizeof(dp)); dp[2]=1; for(int i=3;i<=n;i++){ cout 阅读全文
posted @ 2022-10-04 19:21 lwx_R 阅读(19) 评论(0) 推荐(0) 编辑
摘要:1.递归 每次吧结果相乘 //递归快速幂 double myPow(double x, long long n) { //x x2 x4 x8 x16*x if(n >= 0){ return quickPow(x,n); }else{ //n为负数情况 n=-n; return 1.0/quick 阅读全文
posted @ 2022-10-04 19:17 lwx_R 阅读(21) 评论(0) 推荐(0) 编辑
摘要:vector<int> reversePrint(ListNode* head) { vector<int> ans; if(head==NULL){ return ans; } ListNode* cur=head; while(cur!=NULL){ ans.insert(ans.begin() 阅读全文
posted @ 2022-10-01 18:41 lwx_R 阅读(29) 评论(0) 推荐(0) 编辑
摘要:/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), r 阅读全文
posted @ 2022-10-01 18:40 lwx_R 阅读(24) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示