-
Spring MVC How to handle max upload size exceeded exception
In Spring, you can declare a @ControllerAdvice to catch the ugly max upload size exceeded exception like this :
Date: 2019-08-11 View: 1520
-
Java Swing – Keep dialog window up
The most common (and simple) way to implement a dialog in our application is the JOptionPane class. In this article we will discuss how to “overwrite” the default behaviour of JOptionPane that closes the dialog window when the user clicks a JOptionPane-created button.
Date: 2019-08-11 View: 1520
-
Spring Boot Configure maxSwallowSize in embedded Tomcat
In Spring Boot, you can’t configure the embedded Tomcat maxSwallowSize via the common application properties, there is no option like server.tomcat.*.maxSwallowSize
Date: 2019-08-11 View: 1520
-
Spring @ExceptionHandler and RedirectAttributes
Since Spring 4.3.5 and 5.0 M4, it supports RedirectAttributes argument in the @ExceptionHandler method.
Date: 2019-08-11 View: 1520
-
Linux How to assign execute permission to a .sh file
On *nix, you can use chmod +x file.sh to make a .sh file executable.
Date: 2019-08-11 View: 1520
-
Spring REST API Validation
In Spring MVC, just annotate a @Valid on the @RequestBody to fire the validation process.
Date: 2019-08-11 View: 1520
-
Spring Boot JDBC + MySQL + HikariCP example
In this article, we will show you how to create a Spring Boot JDBC application + MySQL and HikariCP.
Date: 2019-08-11 View: 1520
-
Spring Boot How to know which connection pool is used?
In Spring Boot, @Autowired a javax.sql.DataSource, and you will know which database connection pool is using in the current running application.
Date: 2019-08-11 View: 1520
-
Spring Boot JDBC + Oracle database + Commons DBCP2 example
In this article, we will show you how to create a Spring Boot JDBC application + Oracle database + Commons DBCP2 connection pool.
Date: 2019-08-11 View: 1520
-
Java 8 Optional In Depth
Java 8 has introduced a new class Optional in java.util package. It is used to represent a value is present or absent. The main advantage of this new construct is that No more too many null checks and NullPointerException. It avoids any runtime NullPointerExceptions and supports us in developing clean and neat Java APIs or Applications. Like Collections and arrays, it is also a Container to hold at most one value. Let us explore this new construct with some useful examples.
Date: 2019-08-11 View: 1520
-
How to display all beans loaded by Spring Boot
In Spring Boot, you can use appContext.getBeanDefinitionNames() to get all the beans loaded by the Spring container.
Date: 2019-08-11 View: 1520
-
Java How to download a file from the Internet
This article shows you how to download a file from an URL by using the following methods :
Date: 2019-08-11 View: 1520
-
Oracle PL/SQL DROP function example
This article shows you how to use DROP FUNCTION to delete a function from Oracle database.
Date: 2019-08-11 View: 1520
-
Oracle PL/SQL ABS function example
This ABS() function returns absolute value of a number, for example, the absolute value of 5 is 5, and the absolute value of -5 is also 5. In Mathematics, absolute value can be think of as a distance from zero.
Date: 2019-08-11 View: 1520
-
Oracle PL/SQL ALTER function example
The ALTER FUNCTION statement explicitly recompile a standalone function. Sometimes, ALTER TABLE on the table being used in function will cause the function becomes INVALID, we need to recompile (alter function) it to make it VALID again.
Date: 2019-08-11 View: 1520