![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
Super特特
这个作者很懒,什么都没留下…
展开
-
springboot 外置tomcat配置post请求大小
server.xml中connector标签 配置 maxPostSize="0"/"-1"原创 2022-01-21 14:37:42 · 524 阅读 · 0 评论 -
springboot项目tomcat部署启动2遍定时任务执行2次
解决方案1.禁用springboot内部tomcat<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springfra原创 2021-09-22 18:18:54 · 453 阅读 · 1 评论 -
ListA=ListB操作B集合
String [] strArray = {"a","b","c","d","e","f","g","h","i","j","k","l"};//List<Interger>同List<String> strList = Arrays.asList(strArray);List _strList = new ArrayList(strList);for(int i=0;i<3;i++){ //List<String> listTemp = _strL.原创 2021-04-09 14:14:22 · 504 阅读 · 0 评论 -
springboot异常事务不回滚
异常被手动try{}catch{}了,事务则不会回滚,系统会认为你已经手动进行了异常处理,可以以下处理:1.如果想让事务回滚必须往外抛throw Exception2.手动开启事务回滚,catch 中添加TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); //...原创 2021-01-22 14:23:52 · 668 阅读 · 0 评论 -
jpush(极光)java服务端异步推送消息
public class JpushServiceImpl implements JpushService { @Override @Async public void pushMsg(Entity entity) throws Exception{ String AppKey ="123dggdsfd4567fhsshshdsf";//极光创建的app...原创 2020-04-27 23:13:13 · 684 阅读 · 0 评论 -
Image.getScaledInstance
public image getscaledinstance(intwidth, intheight, inthints)创建此图像的缩放版本。返回一个新的image对象,默认情况下,该对象按指定的width和height呈现图像。即使已经完全加载了初...原创 2020-02-14 19:14:44 · 1610 阅读 · 0 评论 -
linux安装redis
1.下载redis-5.0.7.tar.gz2.home下新建redis文件夹(个人习惯,存放安装包 )3.在usr/local下新建redis(安装位置)4.解压安装包(tar -zxvf redis-5.0.7.tar.gz /usr/local/redis),此路径找不到路径时,加上-C,如下图解压即可5.解压完成后为以下内容6.7.启动red...原创 2019-12-27 14:47:58 · 85 阅读 · 0 评论 -
java获取日期所在周第一天和最后一天
//获取日期所在周的周一的日期public static String getWeekfirstday(String day) throws Exception{ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar cal = Calendar.getInstance(); cal.s...原创 2019-12-12 15:24:01 · 1394 阅读 · 1 评论 -
java获取某天所在月的最后一天
//获取某天所在月的最后一天public static String getlastday(String day) throws Exception{ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat sdf_ny = new SimpleDateFormat("yyyyMM")...原创 2019-12-12 14:40:25 · 621 阅读 · 0 评论 -
java获取日期是星期几
//获取今天是周几public static String getTodayweek(String day) throws Exception{ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar calendar = Calendar.getInstance(); calendar.s...原创 2019-12-12 14:17:49 · 239 阅读 · 0 评论 -
获取2个日期间所有的天数
//获取2个日期间所有的日期public static List<String> getDays(String startTime, String endTime) throws Exception{ // 返回的日期集合 List<String> days = new ArrayList<String>(); SimpleDat...原创 2019-12-12 14:17:00 · 477 阅读 · 1 评论 -
java服务端调用环信接口
调用环信api需要获取环信的tokenpublic class Token { private String access_token; //有效的token字符串 private String expires_in; //token 有效时间,以秒为单位,在有效期内不需要重复获取 private String application;//当前 App 的 U...原创 2019-11-13 17:22:04 · 904 阅读 · 0 评论 -
springboot异步之@Async
springboot开启异步首先要在启动类加上@EnableAsync注解其次在要异步的方法上加上@Async要注意的事项:1.异步方法和调用方法一定要**** 写在不同的类中 ****,如果写在一个类中,是没有效果的2.异步方法一定要是public且非静态的3.异步的类需要由spring管理,其余还有的注意事项,总结中,今天做异步遇到很多要注意的地方,待完善...原创 2019-10-30 17:14:58 · 201 阅读 · 0 评论 -
java调用webservice
//此处只写调用过程,实际开发中 根据具体情况 定义实体(Map)进行参数的传递public static Object sendWSDL() throws Exception { //返回值 Object return_obj = null; private QName paramType = org.apache.axis...原创 2019-01-07 15:43:40 · 284 阅读 · 2 评论 -
java8获得时间及时间的转换
//获得日期LocalDate localDate = LocalDate.now();//2019-01-08//获得时间LocalTime localTime = LocalTime.now();//17:28:02.264//获得年月日时分秒LocalDateTime dateTime = LocalDateTime.now();//2019-01-08T17:28:02.264...原创 2019-01-08 17:40:45 · 870 阅读 · 0 评论 -
java获取时间段内固定时间间隔的所以时间list
//获取时间段内,时间间隔的所以时间点集合public static List<String> getTimes(Date startTime, Date endTime,long ll){ List<String> times = new ArrayList<>(); Calendar calendar = Calendar.getIn...原创 2019-05-16 10:56:46 · 1677 阅读 · 0 评论 -
java8之Stream常用方法
⒈获得集合中的某个字段的list(Node实体,nodeTypeCode字段): List<String> nodeList = allNodeList.stream() .filter(x -> "1".equals(x.getNodeTypeCode()))//过滤使用 ...原创 2019-08-12 18:01:09 · 808 阅读 · 0 评论 -
java不同服务间http post请求
//服务端代码 @RequestMapping(value = "insertMessage",method=RequestMethod.POST) @ResponseBody public Map<String, Object> insertMessage(@RequestBody List<SocketBody> param){ ...原创 2019-09-16 17:11:09 · 448 阅读 · 0 评论 -
java不同服务间http get请求
//请求端代码public List<Model> getModels (){ String url = "http://127.0.0.1:8089/mangent/getModels?time=" + ? + "&code=" + ?; String jsonData = getRequest(url); List&l...原创 2019-09-16 17:27:16 · 319 阅读 · 0 评论 -
安装tomcat报错Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of the
今天win10安装tomcat突然就报错了,做个小记The JRE_HOME environment variable is not defined correctlyThis environment variable is needed to run this program搜索进行了如下配置,tamcat bin目录下setclasspath.bat文件进行配置(Windows环境在...原创 2019-10-09 14:02:00 · 766 阅读 · 0 评论 -
java.util.Calendar
import java.util.Calendar;public class TestCalendar { static Calendar calendar = Calendar.getInstance(); //一些基础的方法 public static void basics(){ //获取年 int year = cal...原创 2018-12-24 16:35:02 · 218 阅读 · 0 评论