Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Tuesday, June 8, 2010

CFLocation in CFScript

I often find myself converting old, long blocks of CFML to CFScript before attempting to refactor, modularize and patternize that code. I do this both to make the code more readable for me and to make the code more portable since much of my refactoring will be done in CFScript anyway. Unfortunately CFScript doesn't support all of the same functions provided for in CFML--in fact, CFScript functions are a very limited set unless you start digging into the Java functions and how to access them in Coldfusion. Yesterday I ran into a need to have CFLocation in my CFScript. It took me a while but I found a really old blog entry with the following solution:
GetPageContext().getResponse().sendRedirect([URL String]);
It works just as I need it to. I haven't yet done the research but I'm assuming this is an example of accessing the Java side of CF. It will be interesting to explore the three functions AND how, apparently, Java supports chaining similar to the jQuery does.