Tag: java
All the articles with the tag "java".
Using Docker: Network Configuration
Examples of communication between containers compare Docker’s default network, links, and a custom bridge network. The article shows how to inspect container IP addresses and network details, and how a custom network lets containers reach one another by name without depending on specific IP addresses.
Migrating SQL Server Data to MySQL: Connection Troubleshooting and Bulk Imports
This article records a SQL Server-to-MySQL migration with Navicat and troubleshooting when the server refuses connections. It also covers MySQL file imports and exports, directory permissions, delimiters, duplicate handling, and default field values during bulk imports.
Spring Boot: Pitfalls with @Async and @Transactional
Using asynchronous conversion of uploaded Word documents to images as an example, this article investigates why @Async did not take effect in Spring Boot. It explains the importance of return types and calls through a proxy, and discusses similar considerations for @Transactional when methods call other methods in the same class.
Using Shiro: Integrating JWT for More Capable Tokens
JWT is integrated with Shiro and Spring Boot to issue tokens after login and parse, validate, and check them for expiry on subsequent requests. This article explains the JWT utility, authentication filter, and configuration properties, and traces a dependency-injection failure caused by constructing the filter manually.
Using Shiro with Tokens
A custom Shiro filter validates tokens on incoming requests. The article covers returning a token after login, adding the filter to the authentication chain, and tracing filter execution order in the source code, then discusses token expiry and distributed authentication that the example has not yet implemented.
Using Shiro Remember Me and Automatic Login: Fixing a deleteMe Cookie
Introduces Shiro rememberMe configuration and automatic login on a later visit, and records a source-code investigation of cookies containing deleteMe. Making the User object used in authentication implement Serializable resolves the serialization failure that breaks the remember-me feature.
Notes on Java’s static Keyword
Using static methods for querying approval documents as an example, this article records observations about static members, direct method calls, and loading order. It also discusses questions about invocation frequency and memory use in business queries.
Java String Comparisons: equals and ==
This article recounts a failed condition caused by using == to compare a value received from JSP with a server-side string. It uses the incident to explain the difference between comparing string contents and comparing object references in Java.