fusiongrokker

Add mappings via code in CF7 using Java

It recently came up on the Model-Glue mailing list that it's possible to create mappings via code in ColdFusion 7 by dropping down to the underlying Java and using undocumented, unsupported features.

This is not exactly the same as creating per-application mappings as you can do in ColdFusion 8, but instead, you're messing with global mappings. It's still pretty rad!

I figured I would go ahead and blog it for my own future reference, and if it helps anyone else in the process, awesome.

factory = createObject('java','coldfusion.server.ServiceFactory'); mappings = factory.runtimeService.getMappings(); // From here you can add and remove mappings as you please. // Add a mapping: mappings["/test"] = "C:\somedirectory"; // Remove a mapping: structDelete(mappings,"/test");

Posted in ColdFusion | 1 Response  

1 response:





Leave this field empty: