Be cautious about property names in external configuration

I have an External configuration file (${appName}-config.groovy) that I wanted to have a global URL declaration such as:

def DAS_SERVICE_URL = "http://24.40.70.14:8090/DAS010WSWAR"
def DTA_SERVICE_URL = "http://PACDCDTAAPP03:8090/dta/controller"

Then what I wanted was to use these globally in this one configuration file such as:

context.param.ServletURL = "${DAS_SERVICE_URL}/services/SERVICENOTIMPLEMENTED"
context.param.performDeviceRefreshBySerialNumber_ENDPOINT = "${DAS_SERVICE_URL}/services/ActivationService.ActivationServiceHttpSoap12Endpoint/"

Then to display them in my index.gsp like:
[DAS_SERVICE_URL]…[http://24.40.70.14:8090/DAS010WSWAR]

But found they where null in the gsp.
[DAS_SERVICE_URL]…[]
 
So I had to add a new value:

application{
    cfg_version = "10.4.2"
    version = "10.4.2"

    DASServiceUrl = DAS_SERVICE_URL
    DTAServiceUrl = DTA_SERVICE_URL

Then reference DASServiceUrl in my gsp

[DAS_SERVICE_URL]…[http://24.40.70.14:8090/DAS010WSWAR]

I never had any errors, just null names. Hope that helps…

 

VN:F [1.9.1_1087]
Rating: 1.0/10 (1 vote cast)
VN:F [1.9.1_1087]
Rating: -1 (from 1 vote)
  • Share/Bookmark

My road to the SCJP Sun Certified Programmer for Java 6 Exam 310-065

I just wanted to relay my thoughts, experiences, and lessons learned on my road to getting Sun Certified as an SCJP 6 Java Programmer.

First off, I have been working with Java since 1996 and just now, have I finally undertaken this challenge. I keep seeing a repeated theme that the SCJP does not really help those seasoned professionals that already have java experience. I want to first say I totally DO NOT AGREE!!!! I feel this way because the SCJP test forced me to learn parts of the JDK that I just have not used. Mostly due to my lack of knowing the new features in the 6 release. if nothing else, it helps me to sharpen my skills, and keep me thinking toward the future and new API’s I can utilize in the field. So in November 2008, I decided to put my efforts to completing that goal. Originally, I wanted to try to get it before the new year. Here is how I faired, and lessons I learned on my road. Read the rest of this entry »

VN:F [1.9.1_1087]
Rating: 7.6/10 (5 votes cast)
VN:F [1.9.1_1087]
Rating: +2 (from 4 votes)
  • Share/Bookmark

ConfigSlurper with dynamic property name from ConfigurationHolder config Object

I spent the better part of my day trying to solve an issue where I construct a named configuration property, then I wanted to get that property from the config object.

Seemed simple enough… NOT FOR ME. Maybe it was just a Friday or something but…. Here is what I found
Read the rest of this entry »

VN:F [1.9.1_1087]
Rating: 5.3/10 (4 votes cast)
VN:F [1.9.1_1087]
Rating: +1 (from 3 votes)
  • Share/Bookmark

Groovy Spring DSL Constructor Argument

I have been trying to create an inner class instance of a Spring constructor argument and have been looking at the Grails documentation that states

Constructor arguments can be defined using parameters to each method that reside between the class of the bean and the last closure: (from http://www.grails.org/Spring+Bean+Builder)

bb.beans {
   exampleBean(MyExampleBean, "firstArgument", 2) {
       someProperty = [1,2,3]
   }
}

Read the rest of this entry »

VN:F [1.9.1_1087]
Rating: 9.5/10 (2 votes cast)
VN:F [1.9.1_1087]
Rating: 0 (from 2 votes)
  • Share/Bookmark

Using WebServiceTemplate and HTTPClient to enable Webservice read timeout

I was tasked to implement read timeouts in my Spring webservices. I need to be able to implement this on dozens of webservices fairly easy and be maintainable. I also wanted to use Groovy Spring DSL for my bean declarations, and have my timeout configurable, and Integration testable.

Read the rest of this entry »

VN:F [1.9.1_1087]
Rating: 6.3/10 (3 votes cast)
VN:F [1.9.1_1087]
Rating: -1 (from 1 vote)
  • Share/Bookmark