Solved

Application.,cfc and changes in this tag

Posted on 2011-02-19
1
870 Views
Last Modified: 2012-05-11
i have defined the application.cfc in my website and used the cfscript> tag to define the settings using the this tag like

<cfscript>
       this.name = "Test";
       this.applicationTimeout = createTimeSpan(0,1,0,0);
       this.clientmanagement= "yes";
       this.loginstorage = "session" ;
       this.sessionmanagement = "yes";
       this.sessiontimeout = createTimeSpan(0,0,20,0);
       this.setClientCookies = "yes";
       this.setDomainCookies = "yes";
       this.scriptProtect = "all";
       if left(server.ColdFusion.ProductVersion,1) GT 8
       this.googlemapkey = "blah blah blah";
       end if
   </cfscript>

now apparently it is throwing error,

 Invalid CFML construct found on line 12 at column 15.
ColdFusion was looking at the following text:

left

The CFML compiler was processing:

    * A script statement beginning with if on line 12, column 12.
    * A cfscript tag beginning on line 2, column 2.

i was sure that it will throw an error but how can i do this in good way

Please guide
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 52

Accepted Solution

by:
_agx_ earned 125 total points
ID: 34934562
if left(server.ColdFusion.ProductVersion,1) GT 8
       this.googlemapkey = "blah blah blah";
end if


That's not valid cfscript.  There's no "end if" and the comparison must be enclosed in parenthesis (...)

ie
if (listFirst(server.ColdFusion.ProductVersion) GT 8) {
    this.googlemapkey = "blah blah blah";
}    

0

Featured Post

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question