How to use Java 8 functional programming more elegantly?

Stream and Optional in Java 8 bring us the fun of functional programming, but Java still lacks many key features of functional programming. Lambda Expressions Optional and Stream It's just the tip of the iceberg for functional programming. This also led to the emergence of varvr and functionlajava class libraries, both of which originated from ...

Added by examiz on Thu, 14 May 2020 08:49:26 +0300

The SpringBoot Getting Started series implements uniform exception handling, which is as simple as that!

Next, we will focus on how to use uniform exception handling in SpringBoot applications.How do I reuse exception data with normal business data and return it as a json?   Why uniform exception handling Currently, our project architecture is basically a separate front-end and back-end model: developed using Restful interface protocol, the fo ...

Added by DeGauss on Wed, 13 May 2020 20:00:56 +0300

Applicant Ali, byte beating, Spring IOC and factory mode that Meituan must master

Spring IOC and Factory Mode PS: The content of this article is hard core, which requires a better understanding of java's object-oriented, reflection, class loader, generics, properties, XML and other basic knowledge. (1) Brief introduction Before talking about Spring IOC, it's necessary to talk about Factory Pattern.Factory mode separates the ...

Added by edkellett on Fri, 08 May 2020 20:56:05 +0300

The loading of resources in Spring is the same thing!

1. Introduction In JDK, java.net.URL is applicable to the classes that load resources, but the implementation classes of URL access network resources, and there is no way to obtain files and ServletContext from class path or relative path, Although the new handler can be implemented by customizing the extended URL interface, it is very complex. ...

Added by isam4m on Thu, 07 May 2020 16:15:51 +0300

Spring Security automatically kicks off the previous logged-in user, a configuration is complete!

After successful login, automatically kick off the previous login user. Songge first saw this feature inside the button. It was fun at that time. Once you've done your own development, you've met the same requirements. Just as the recent Spring Security series is being serialized, you can use Spring Security to talk about how this function work ...

Added by bl00dshooter on Thu, 07 May 2020 04:01:23 +0300

How to quickly view the IP address and other information of the login user in Spring Security?

Last article I've talked about how to use a more elegant way to customize Spring Security login logic. A more elegant way can effectively avoid the inefficiency brought by custom filters. I suggest you read it and understand the authentication logic in Spring Security by the way. Based on the above, this paper will continue to discuss with you ...

Added by jimjack145 on Wed, 06 May 2020 11:21:22 +0300

18 examples take you to master Java 8 date time processing!

Author: Pang xiansen https://juejin.im/post/5a795bad6fb9a0634f407ae5 Java 8 introduces a new date time API. In the tutorial, we will learn how to use the new API through some simple examples. The way Java deals with date, calendar and time has always been criticized by the community. Setting java.util.Date as a variable type and the non thre ...

Added by matthewc on Wed, 06 May 2020 08:54:37 +0300

Popular understanding of spring source code -- parsing and registering bean definitions

Popular understanding of spring source code (5) -- parsing and registering bean definitions Last section talked about how to get document. After converting the document to document, the next extraction and registration bean is our play. protected int doLoadBeanDefinitions(InputSource inputSource, Resource resource) throws Bea ...

Added by TEENFRONT on Wed, 06 May 2020 00:53:03 +0300

International multilingual configuration

The static multilingual configuration file is placed in the Resource Bundle under the resources directory and configured in the form of key=value For example, in Chinese: messages ABCD cn.properties Property1 = property1 Property2 = property2 English: property1=property one property2=property two Configuration Internationalization: @Con ...

Added by ron814 on Tue, 05 May 2020 22:44:36 +0300

Spring transaction management [Focus]

Spring transaction management Commit and rollback transactions to spring   1, Brief introduction In Java EE development, transactions are in the Service layer, Judged by the program: in case of abnormal transaction rollback, no abnormal transaction commit occurs. Spring uses AOP technology for transaction control, and helps developers t ...

Added by fredroines on Tue, 05 May 2020 21:50:16 +0300