Interesting bug with Application.cfc and mappings and the Application constructor

A few years ago I wrote a small component for ColdBox that actually allowed me to modify the Application settings, specifically the ORM settings and cfclocation. There was nothing special to this component and I had it working for sometime, that was until I moved ColdBox away from the root of the application and used per application mappings instead.

Which is when I discovered something very interesting with Application.cfc and the constructor.

ColdBox and changing content headers in script

Recently I needed the ability to set response headers in script, previously I had just used the layout to use the tag version. Now although it isn't anything new and we have been able to do this in ColdFusion since the days ColdFusion was written in Java, if not earlier, I thought I would share what I was trying to achieve and provide a better insight to the possibilities.