Semaphore详解 主程序package lock;import java.util.concurrent.Semaphore;public class TestLock { public static void main(String[] args) { Semaphore semaphore = new Semaphore(2); for (int j = 0; ...
SpringBoot参数传递和接收的几种方式 @PathVariable前端传递格式/user/scy/123456,后端接收格式/user/{name}/{password},只能接收 URL 路径里的参数。@RequestParam能接收 URL 问号后跟着的参数,不管是 GET 还是 POST,虽然一般只有 GET 请求才会在 URL 后边跟参数,问号 ? 后面的部分,使用 & 区分参数。@RequestBody...
VUE使用总结 新建vue项目这篇有详解vue新建项目模板语法文本–两种表达方式<span>Message: {{ msg }}</span><span v-text="msg">123</span> msg在data中定义, 注意此时的123不再显示通过使用 v-once 指令,你也能执行一次性地插值,当数据改变时,插值处的内容不会更新。&...
Mybatis逆向工程 第一步:pom.xml增加如下配置。集成所需依赖 <dependency> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-core</artifactId> ...
shiro加入自定义过滤器 ##SpringBoot下Shiro添加过滤器自定义filter继承AdviceFilter package com.itdage.filter; import org.apache.shiro.web.filter.AccessControlFilter; import org.apache.shiro.web.filter.authz.AuthorizationFilter;...
Linux下监听mysql是否宕机 监听mysql是否挂掉监听脚本 listenMysql.sh pgrep mysqld &> /software/mysql/null if [ $? -gt 0 ] then echo "date mysql is stop" >> /software/mysql/listenMysql.log service...
nginx部署jar包下的负载均衡 ##Nginx部署多个springboot jar包以及负载均衡1. 此时访问https://www.itdage.top/weixin-server会随机找到8888或8889端口下的weixin-server项目;访问https://www.itdage.top/weixin-server3会找到8889下的weixin-server项目; #user nobody; ...
Linux下实现自动部署jar包 Git+ Github + Maven + Linux实现自动部署jar包 #拉取代码 echo pull project cd /code/weixin-server(项目名) git pull #maven打包 echo maven build cd /code/weixin-server(项目名)/ mvn...
Java腾讯企业邮箱发送邮件 Java通过腾讯企业邮箱发送邮件(多人发送)企业邮箱需要使用ssl private static String account = “企业邮箱账户”;// 登录账户 private static String password = “企业邮箱密码”;// 登录密码 private static String host = “smtp.exmail.qq.com”;// 服务器地址 ...
SpringBoot集成Thymeleaf总结 SpringBoot集成Thymeleaf总结表达式语法: ${}:变量表达式,用法: ${session.user.name}<span th:text="${book.author.name}">< th:each="book : ${books}">*{}:选择表达式 <div th:object="${session.user}"> ..
SpringBoot集成Mybatis Spring Boot集成Mybatis:Spring Boot不是提供一种新的解决方案是在Spring框架基础之上实现快速开发应用Spring Boot特点: 创建独立的Spring应用程序嵌入的Tomcat,无需部署war文件简化Maven配置自动配置Spring绝对没有代码生成和对XML没有要求配置Spring Boot主要内容(一律采用Java注解配置) S
Tomcat集成WebSocket Tomcat集成WebSocket实现一对一聊天效果需要的jar包 javaee-api7.0web端代码(后端没有进行转码,测试时这里的用户名用英文和数字,中文不识别)<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%>Insert title h
SSM下的Java上传文件 SSM环境下的Java上传文件通过MultipartFile类上传文件。步骤: a.SpringMvc中加入配置 <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
hashMap的三种遍历方式 public void testClass(){ HashMap<String, String> hashMap = new HashMap<String, String>(); hashMap.put("1", "1"); hashMap.put("2", "2"); Set<Entry<String, String>> entryS
tomcat reload 时报web应用已停止,不能加载jdbc异常的解决方法 INFO: Illegal access: this web application instance has been stopped already. Could not load [com.mysql.jdbc.SQLError]. The following stack trace is thrown for debugging purposes as well as to attempt