Just discovered StackOverflow had an option to display your flair. Why not?
Android: IntelliJ IDEA/Android Studio Quick Tip
I’ve started using IntelliJ as my IDE of choice for developing backend APIs and Android applications. One really nice feature, which is also available in Android Studio, is the option to create strings.xml values on the fly. All you need to do is type the name of the desired string resource and then the “bulb” icon will appear asking you if you want to create that resource. Super simple, but extremely convenient for those times when you are editing a lot of xml files in Android.
Grails: Displaying messages from messages.properties in Quartz Job
When working with Quartz Jobs, you may want to take advantage of Strings that are located in the messages.properties file. In order to do this, you need to get a reference to the messageSource bean and then call the getMessage() method with the name of the message that you want to use, whatever objects you need to pass to the message and finally the locale. (examples below)
def messageSource
...
messageSource.getMessage('my.msg', [myObject] as Object[], Locale.US)
Without any parameters in the message:
def messageSource
...
messageSource.getMessage('my.msg.no.params', null, Locale.US)
Configuring Dev and Prod Environments in Spring 3.1
Recently I have been exploring the Spring MVC Framework using on Spring 3.1. Based on my Grails experience I was surprised by the amount of manual configuration that is required. Nevertheless, I thought I would quickly share how to configure development and production environments in your application. Spring 3.1 introduced what is known as Profiles, which allow the developer to create various bean definitions to be used in different environments.
For instance, in order to use a different database for your dev and prod environments you could configure your sevlet-context.xml file with the following:
Then in your web.xml file you would have the following if you were deploying for the dev environment:
It’s just that simple…