15-12-2017 21

Spring Boot not serving static content

I'm banging my head against the wall for a couple of hours now. My project is almost finished, but I can't get it to serve static content.I've placed a folder named static under src/main/resources. Inside it I have a folder named images. When I package the app and run it, it can't find the images I have put on that folder.

Read More
16-12-2017 21

How to shutdown a Spring Boot Application in a correct way?

In the Spring Boot Document, they said that 'Each SpringApplication will register a shutdown hook with the JVM to ensure that the ApplicationContext is closed gracefully on exit.'When I click ctrl+c on the shell command, the application can be shutdown gracefully. If I run the application in a production machine, I have to use the command java -jar ProApplicaton.jar. But I can't close the shell terminal, otherwise it will close the process.

Read More
17-12-2017 21

How final keyword works

In Java we use final keyword with variables to specify its values are not to be changed. But I see that you can change the value in the constructor / methods of the class. Again, if the variable is static then it is a compilation error.Here is the code:Above code works fine and no errors.Now change the variable as static:

Read More
17-12-2017 21

How to convert String to long in Java?

I got a simple question in Java: How can I convert a String that was obtained by Long.toString() to long?

Read More
18-12-2017 21

A quick and easy way to join array elements with a separator (the opposite of split) in Java [duplicate]

See Related .NET questionI'm looking for a quick and easy way to do exactly the opposite of split so that it will cause ["a","b","c"] to become "a,b,c"Iterating through an array requires either adding a condition (if this is not the last element, add the seperator) or using substring to remove the last separator.

Read More
20-12-2017 21

Getting error org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined

I am running NTLM using Spring Security, I am getting the following errorHow can I resolve this error?I have the following defined in web.xmlUpdate 1I resolved that error, now I am gettingand I have the followingI changed my applicationContext.xml as follows because like @Sean Patrick Floyd mentioned some elements were old and dead and buried. However I have other errors now which needs to be fixed :-)

Read More
21-12-2017 21

The 3 different equals

What is the difference between =, ==, and ===?I think using one equal sign is to declare a variable while two equal signs is for a comparison condition and lastly three equal signs is for comparing values of declared variables.

Read More
22-12-2017 21

Problems with lib-icu dependency when installing Symfony 2.3.x via Composer

I've had no problems installing Symfony 2.2.x using Composer, I've always just copied the stable version at http://symfony.com/download.(I have Composer installed globally) Curious about 2.3.0-RC1 I figured this would go smoothly:But got shutdown by the following errors:Do I need to tweak the composer.json file?

Read More
23-12-2017 21

Convert a PHP script into a stand-alone windows executable

I want to automate a fairly simple task. For this I have written a small PHP script which I run from the command line using PHP-CLI. Now I want to hand over this script to someone but I do not want to:Is there a way to create a .exe version of the PHP script. I am really not much worried about de-compilation; I am more worried about asking people to install and configure PHP.

Read More