Skip to content
Advertisement

Add context path to Spring Boot application

I am trying to set a Spring Boot applications context root programmatically. The reason for the context root is we want the app to be accessed from localhost:port/{app_name} and have all the controller paths append to it. Here is the application configuration file for the web-app. Here is the index controller for the main page. The new root of the

Calling equals on string literal

I just was tidying my code a bit and there was this piece: Then I thought of doing it the other way around to get rid of the checking for null: It definitely works, but is this safe to do so? I mean string literals are stored in a common pool, while string object create by new are on the

Java fade in and out of images

I am trying to learn how to fade in and out images into another image or from another image. So, if I have 2 images, and 1 is being displayed at the moment, I want to display another image in the background and fade the first image out into the 2nd image. OR, I want to set the focus on

Opening CSV with UTF-8 BOM via Excel

I create csv file with data by the means of java. And I faced the following well-known issue: the letters in Portuguese were displayed by the wrong way in Excel (when opening by double click). I solved this by UTF-16LE+BOM, but excel started to recognize tabs as columns separators instead of commas. So I looked up for another solution and

Simplest way to print an `IntStream` as a `String`

With Java-8 I can easily treat a String (or any CharSequence) as an IntStream using either the chars or the codePoints method. IntStream chars = “Hello world.”.codePoints(); I can then manipulate …

Advertisement