Gregory's Blog

Needed to develop a new proxy function

Raymond's approach was typical in the mid 2000's. He posted a form to a .cfm page, and the server processed server side logic as well as performing client side operations, like setting form values on the client. However, Ajax is a different beast. Most of our Kendo HTML5 interfaces do not post to another HTML page. Instead, the UI elements, such as the Kendo window, posts limited data to a function that has to perform all of the logic without refreshing the client page. However, for several reasons, the blog.cfc component does not have all of the information that I need to do this successfully. First, we can't get session vars in the main blog.cfc. Raymond (and et-al) had another application.cfm in the org/cambden/blog folder that prevented this component from having access to the session variables set on the /blogCfc/application.cfm template. Cfc's should have access to the session scope unless it finds another application.cfm (or cfc) template, and here, this is the case. This poses some problems with ajax. I do not want to have to hard code authentication variables, like the isAdmin, in a javascript ajax post. This is quite insecure. I tried in vain to get the blog.cfc component to work for my purposes. After finding and eliminating the 'other' application.cfm template which caused problems accessing the session scope, I was able to obtain session variables, but the elimination of the application.cfm template in the same directory caused new problems. One example is that the isUserInRole function is now erroring out with an 'You have attempted to dereference a scalar variable of type class java.lang.String as a structure with members.'. This new error was raised throughout the blog.cfc template. Another issue is that I suspect that the /blogCfc/org/delmore/coldfishconfig.xml file is not working when the application.cfm template is disabled. This file most likely deals with the cfauthentication tag. In order to have the session scope, and in order to potentially cache the code after an ajax operation, I had to develop a new template to act as a proxy. I am not using a .cfc component for ajax post operations as I need the session variables and need to perform client side operations, such as setting form values, and caching the output of the page. Goals: The proxy template will use Raymond's blog.cfc to perform all database operations. Whenever possible, I will perform server side business logic using Raymonds Blog.cfc.

This entry was posted on November 9, 2018 at 10:42 PM and has received 84 views.

There are currently 0 comments.

Your input and contributions are welcomed!

If you have an idea, BlogCfc based code, or a theme that you have built using this site that you want to share, please contribute by making a post here or share it by contacting us! This community can only thrive if we continue to work together.

Images and Photography:

Gregory Alexander either owns the copyright, or has the rights to use, all images and photographs on the site. If an image is not part of the "Gregory's Blog" open sourced distribution package, and instead is part of a personal blog post or a comment, please contact us and the author of the post or comment to obtain permission if you would like to use a personal image or photograph found on this site.


Portions of Gregory's Blog are powered on the server side by BlogCfc, an open source blog developed by Raymond Camden. Revitalizing BlogCfc was a part of my orginal inspiration that prompted me to design this site. Some of the major open source contributers to BlogCfc include:

  1. Peter Farrell: the author of 'Lyla Captcha' that is used on this blog.
  2. Pete Freitag: the author of the 'ColdFish' code formatter that is also used on this blog.