ColdFusion Structure

I'm looping an array of records (from a fixed length feed)
and creating a structure for each required field. Then for every
loop, I'm passing this structure to a function to check if certain
required field in the structure's element is left empty.
The structure should look something like this:
<cfloop from="1" to="#ArrayLen(MyFile)#" index="i">
<cfset aEachLine
=StructNew()>
<cfset aEachLine["LastName"]="#Mid(MyFile
,17,40)#">
<cfset aEachLine["FirstName"]="#Mid(MyFile
,57,20)#">
<cfset aEachLine["Address"]="#Mid(MyFile
,140,38)#">
<cfset aEachLine["City"]="#Mid(MyFile
,254,19)#">
<cfset aEachLine["State"]="#Mid(MyFile
,273,2)#">
<cfset aEachLine["Country"]="#Mid(MyFile
,284,4)#">
In this example I'm assuming that my structure is this short
<CFSET CheckStructValue=CheckThisStruc(aEachLine)>
</cfloop>
How do I check if any of those struct. value is
empty?

alecken,
I don't think looping is the only way but suggested this
approach because, I think, you can more easily write code that
determines which key in a struct is empty (if any) and then report
back to the user the issue (or do something else such as inserting
default values, etc.).
That said, since the purpose of StructFindValue is to locate
any key that has the value supplied, it should work. I just wrote
and tested the following code and it worked:
<cfscript>
myStruct = StructNew();
myStruct.key1 = "Key 1 Value";
myStruct.key2 = "Key 2 Value";
myStruct.key3 = "";
myFind = StructFindValue(myStruct,"");
</cfscript>
<cfdump var="#myFind#">
The resulting output of an array of structures showed me that
key 3 was empty.
While this works to locate empty keys, I would still need to
write code that determines which key was empty and then what to do
from there. I just find it easier to loop over the struct and act
accordingly on each key it finds that is empty as it loops over the
struct. But that's just me!
There are some structure functions on cflib.org that might
help but in a cursory look over the site, I did not see anything
off hand.

Similar Messages

  • Manipulating coldfusion structures in flex

    Hi,
    I am beginner with flex. I was trying a sample login application using flex and coldfusion. I was able to connect to coldfusion, and was able to show an alert message when the user successfully logins. I was just returning a numeric value of 1 if the login is successful. But I want to store the details of the logged in user like first name, last name, and display using flex. I am storing the values in a coldfusion structure with return type struct. Can anyone please suggest me how this can be done in flex?
    Thanks.

    You have to install the extensions. Start here:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=cfwizards_2.html

  • How to access a JSON structure key that starts with a number

    I've got an odd issue here.  I'm accessing someone else's JSON structure so I am not able to change it.  The JSON structure keys are named with both characters and numbers like this:
    0
    198456
    product_id
    198456
    1
    Rashaan Houston feat Tony Loreto
    artist
    Rashaan Houston feat Tony Loreto
    So, in other words, there's a key named "0" and a key named "product_id", both of which contain the same key.  Why they did that, I don't know, but they did.
    In one of the instances, the data stored under the text-named key isn't the same as the numerical-named key.  I tried to output the data in the numerical key like this (it's an array of structures):
    #strStompyJSON.data[1].0#
    but I get the following error:
    Invalid CFML construct found on line 41 at column 31.
    ColdFusion was looking at the following text:
    .0
    When I do the following, it works fine:
    #strStompyJSON.data[1].product_id#
    So it looks as though CF doesn't like accessing a variable that starts with a number.  I am able to loop through the structure using a collection loop, and it outputs all of the keys (including the numerical ones) and their values using the following code:
    <cfloop collection="#strStompyJSON.data[1]#" item="key">
    #key#: #strStompyJSON.data[1][key]#<br />
    </cfloop>
    However, that doesn't allow me a way to access specific keys named with a number.  Is there a way that I can specifically access a key that is named with a number?
    thanks!
    Mike

    No problem--glad it worked out.
    As a follow-up to this, I'd encourage you to keep the bracket notation in mind during future development.  It is EXTREMELY useful in a lot of situations.
    For example, if you're building a structure on the fly with dynamic keys, bracket notation is extremely helpful:
         <cfset authors = structnew()>
         <cfloop list="authorlist" index="name">
              <cfset authors[name] = getbooklist(name)>
         </cfloop>
    Also, bracket notation is really nice when creating json from ColdFusion structures.  Consider this:
         <cfset author = structnew()>
         <cfset author.name = "Neil Gaiman">
         <cfset author.genre = "Fantasy">
         <cfset author.awesome = true>
         <cfset authorjson = serializejson(author)>
    By default, the serialized json produced will have all UPPER CASE keys.  Not a big deal in most cases, but if you're returning the json to something (like a JS library) that is expecting keys in a certain case, it can be a problem.  Fortunately, bracket notation allows you to specify exactly what case you want the structure's keys to be in:
         <cfset author = structnew()>
         <cfset author['name'] = "Neil Gaiman">
         <cfset author['Genre'] = "Fantasy">
         <cfset author['AWESOME'] = true>
         <cfset authorjson = serializejson(author)>

  • How to fix a problem with the order of strings in a JSON response for a CFHTTP request?

    Good morning, guys! (It's 10:50 a.m. in Brazil)
    First of all, I'm still new at CF and my questions may seem too much silly and my English's not the best, so, please be patient with me. hehe
    Well, I'm accessing a link via CFHTTP that gives me a JSON response. I'm not familiar with JSON yet, so I'm working it as a string and using string functions (Find,RemoveChars,Replace,etc), but it happens to me that I'm receiving a certain kind of order of the strings list from the JSON when I access it directly from the browser and other kind of order totally different when I access it from the CFHTTP.
    I only figured it out because I was working at home with my code and there everything went just fine as expected. Then I brought to my job to develop a little bit more as soon as I get a free time and here my code doesn't work anymore. When I took a look at the JSON by a CFOUTPUT, I realized the strings were in a different order.
    Does anyone know why is it happening?
    Link to the JSON: http://sigmine.dnpm.gov.br/ArcGIS/rest/services/extra/dados_dnpm/MapServer/0/query?text=83 0620/2012&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelInter sects&where=&returnGeometry=true&outSR=&outFields=FID,Shape,PROCESSO,ID,NUMERO,ANO,AREA_HA ,FASE,ULT_EVENTO,NOME,SUBS,USO,UF&f=pjson
    Basic code simplified to find out that the order of strings were coming different when access by CFHTTP:
    <cfhttp url="#URLAbove#" method="get" result="DadosDoDNPM" charset="utf-8" timeout="10000" />
    <cfset DadosJSON = deserializeJSON(DadosDoDNPM.FileContent) />
    <cfif arrayLen(DadosJSON.features)>
        <cfset CodigoFonteJSON = ToString(serialize(DadosJSON.features)) />   
        <cfoutput> #CodigoFonteJSON# </cfoutput>
    </cfif>
    Is there a way to fix it and to make my code work everywhere?
    If it matters, I use Railo at home and at my job.
    Since now, I thank you.

    When you deserialize JSON data, ColdFusion converts it into native structures and arrays (roughly equivalent to JavaScript objects and arrays).  In ColdFusion, structures are unordered (that is, they don't maintain keys in any particular ordered sequence).
    This really shouldn't be a problem though, at least not if you just want to work with the data contained in the deserialized JSON structure.  So DadosJSON should be a native ColdFusion structure, and you can interact with it like any other structure in ColdFusion.  In fact, you should not have to re-serialize it at all unless you need to send it to an external application using JSON.
    Why are you reserializing the data?  And why use serialize() instead of serializeJSON()?
    -Carl V.

  • Accessing a tab of a specific web page using cfhttp

    Hello, CFers!
    I need to access a remote page using the cfhttp. To be more specific, I need to access this page: https://sistemas.dnpm.gov.br/SCM/Extra/site/admin/dadosProcesso.aspx?numero=861738&ano=2013 (Sorry, Brazilian government sites works better only in the I.E.)
    This is a site of the Brazillian government that supervises mining areas all over the country. Each mining area has its own "numero" (number) and the "ano" (year) when it was registered at the National Department of Mineral Production - DNPM agency. As you can see (if you clicked the link to the DNPM website) there's a tab "Poligonal" at the top of it. Clicking on it will start a function created probably by the ASP.NET and it will generate a PNG image showing the area and some other processes near it. Example of the link above:
    So here is the problem: Can I get the data from the "poligonal" tab using the CFHTTP, knowing the poligonal page doesn't have a direct link? I tried all I could to find a way to get this image, checked I the sourcecode, but I couldn't find any way to solve my problem. That's why I came here to see if somebody can help me with this.
    Sorry for my bad English. I hope you guys undertand me.
    Being sure of your pacience and attention, since now I thank you.

    Aegis Kleais, I have tried contacting the developer, but I got no answer from him so far.
    I tried something and now I can access the content that the tab shows me (with a little help of a library of Ben Nadal):
    <!--- 
    Função escrita pelo Ben Nadel
    Detalhe de funcionamento em http://www.bennadel.com/blog/779-Parsing-HTML-Tag-Data-Into-A-ColdFusion-Structure.htm
    --->
    <cffunction name="ParseHTMLTag" access="public" returntype="struct" output="false" hint="Parses the given HTML tag into a ColdFusion struct.">
    <cfargument name="HTML" type="string" required="true" hint="The raw HTML for the tag."/>
        <cfset var LOCAL = StructNew() />
    <cfset LOCAL.Tag = StructNew() />
    <cfset LOCAL.Tag.HTML = ARGUMENTS.HTML />
    <cfset LOCAL.Tag.Name = "" />
    <cfset LOCAL.Tag.Attributes = StructNew() />
    <cfset LOCAL.NamePattern = CreateObject("java","java.util.regex.Pattern").Compile("^<(\w+)")/>
    <cfset LOCAL.NameMatcher = LOCAL.NamePattern.Matcher(ARGUMENTS.HTML) />
        <cfif LOCAL.NameMatcher.Find()>
    <cfset LOCAL.Tag.Name = UCase(LOCAL.NameMatcher.Group( 1 )) />
    </cfif>
    <cfset LOCAL.AttributePattern = CreateObject("java","java.util.regex.Pattern").Compile("\s+(\w+)(?:\s*=\s*(""[^""]*""|[^\ s>]*))?")/>
    <cfset LOCAL.AttributeMatcher = LOCAL.AttributePattern.Matcher(ARGUMENTS.HTML) />
    <cfloop condition="LOCAL.AttributeMatcher.Find()">
    <cfset LOCAL.Name = LOCAL.AttributeMatcher.Group( 1 ) />
    <cfset LOCAL.Tag.Attributes[ LOCAL.Name ] = "" />
    <cfset LOCAL.Value = LOCAL.AttributeMatcher.Group( 2 ) />
    <cfif StructKeyExists( LOCAL, "Value" )>
    <cfset LOCAL.Value = LOCAL.Value.ReplaceAll("^""|""$","") />
    <cfset LOCAL.Tag.Attributes[ LOCAL.Name ] = LOCAL.Value />
    </cfif>
    </cfloop>
        <cfreturn LOCAL.Tag />
    </cffunction>
    <cfset urlDestino = "https://sistemas.dnpm.gov.br/SCM/Extra/site/admin/dadosProcesso.aspx?numero=861738&ano=201 3"/>
    <!--- Primeira chamada, com o objetivo de obter os cabeçalhos e os campos ocultos para dar continuidade à navegação aqui você poderá dinamizar o resultado de acordo com o que você precisar --->
    <cfhttp url="#urlDestino#" method="get" charset="utf-8" result="gResult" timeout="900"/>
    <!---//OBTER O CABEÇALHO DA PÁGINA //--->
    <!---capturo o cabeçalho da página  e delimito em uma lista apenas os que quero passar para as páginas seguintes --->
    <cfset requestHeaders = getHttpRequestData().headers/>
    <cfset rhList              = 'accept,accept-encoding,accept-language,cookie,cache-control,connection,pragma,user-agent '/>
    <!---//OBTER OS CAMPOS OCULTOS DA PÁGINA //--->
    <!--- expressão regular para localizar todos os inputs do html da página
       que pode ser aprimorada para localizar apenas os hiddens --->
    <cfset hiddenFields = reMatchNoCase("(?i)<input [^>]*[^>]*?>",gResult.fileContent)/>
    <!--- A partir da função do Ben, eu extraio o nome e os valores dos inputs
       que serão postados para a página seguinte, excluindo os valores que desviam do resultado esperado --->
    <cfset formFields     = []/>
    <cfloop index="input" from="1" to="#arrayLen(hiddenFields)#">
    <cfset inputResult = ParseHTMLTag(hiddenFields[input])/>
        <cfif  NOT findNoCase('btnConsultarProcesso',inputResult.ATTRIBUTES.name)
        AND NOT findNoCase('btnDadosBasicos',inputResult.ATTRIBUTES.name)>
    <cfset formFields[input]["name"]  = inputResult.ATTRIBUTES.name/>
            <cfset formFields[input]["value"] = inputResult.ATTRIBUTES.value/>
    </cfif>
    </cfloop>   
    <!---//NAVEGAR PARA PÁGINA POLIGONAL //--->
    <cfhttp url="#urlDestino#" method="post" charset="utf-8" result="fResult" timeout="900">
         <!--- injeta os form fields --->  
        <cfloop array="#formFields#" index="key">
            <cfhttpparam type="formfield" name="#key.name#" value="#key.value#"/>
        </cfloop>
        <!--- injeta o cabeçalho--->
        <cfloop collection="#requestHeaders#" index="key">
             <cfif listFind(rhList,key)>
             <cfhttpparam type="header" name="#key#" value="#requestHeaders[key]#"/>
            </cfif>
        </cfloop>
    </cfhttp>        
    <!---//VISUALIZA A PÁGINA POLIGONAL //--->
    <cfoutput>#fResult.fileContent#</cfoutput>
    That's it.
    And thanks for helping me!

  • Code Throwing error sometimes.

    Hi All,
    I am using the following code to convert a ColdFusion Query Object to ColdFusion structure to work in Kendo UI datagrid.
    <cffunction name="convertQueryToKendoJSON" access="public" returntype="Struct" hint="Converts a ColdFusion Query Object into Kendo UI format JSON">
              <cfargument name="queryObject" required="true" type="query" hint="ColdFusion Query Object" />
              <cfset var returnStruct = structNew() />
              <cfset var tempArray = arrayNew(1) />
              <!--- Loop over the query Object and create one structure Object for each row and query fields are the structure keyfields
                        Store the structure into an array Object. --->
              <cfloop query="arguments.queryObject">
                        <cfset tempStruct = structNew() />
                        <cfloop list="#arguments.queryObject.columnList#" index="columnName">
                                  <cfset tempStruct[columnName] = arguments.queryObject[columnName][arguments.queryObject.currentRow] />
                        </cfloop>
                        <cfset arrayAppend(tempArray, tempStruct) />
              </cfloop>
              <!--- Store the Array into result key field of the returnStruct --->
              <cfset returnStruct['results'] = tempArray />
              <!--- If record Count value exists in the query then only set the totalRecords value --->
              <cfif findNoCase("ntRecordCount", arguments.queryObject.columnList)>
                        <cfset returnStruct['totalRecords'] = arguments.queryObject.ntRecordCount />
              </cfif>
              <cfreturn returnStruct />
    </cffunction>
    It is working fine most of the times. But, in some cases when I am getting the query object from a stored Proc call or from QoQ opearation then I am getting the following error.
    [Table (rows 4 columns NTRECORDCOUNT, NTROWINDEX, NTLEAD_ROUTING_ALGOID, VCROUTING_ALGO, DTCREATED, DTLAST_UPDATED, NTSORT_ORDER): [NTRECORDCOUNT: coldfusion.sql.QueryColumn@10ec6d0] [NTROWINDEX: coldfusion.sql.QueryColumn@11e9be0] [NTLEAD_ROUTING_ALGOID: coldfusion.sql.QueryColumn@8b96e1] [VCROUTING_ALGO: coldfusion.sql.QueryColumn@5e9f7e] [DTCREATED: coldfusion.sql.QueryColumn@3947f5] [DTLAST_UPDATED: coldfusion.sql.QueryColumn@a35419] [NTSORT_ORDER: coldfusion.sql.QueryColumn@e669f3] ] is not indexable by NTSERVICE_TYPEID
    NOTE: I am not getting the error always, sometimes I am getting this error.
    System Info:
    DataBase: MS SQL 2008
    CF - ColdFusion  9,0,2,282541 Enterprise Edition

    Hi Dan,
    I got following log report.
    ColumnList:
    BTACTIVE,NTCOMPANYID,VCCOMPANY_NAME
    Error Message:
    [Table (rows 311 columns ntCompanyID, vcCompany_Name, btActive): [ntCompanyID: coldfusion.sql.QueryColumn@5d213b6c] [vcCompany_Name: coldfusion.sql.QueryColumn@30c45f38] [btActive: coldfusion.sql.QueryColumn@2c476e8b] ] is not indexable by VCOFFICE_NAME
    QueryObject Loged in Error Log:
    {"QUERYOBJECT":{"COLUMNS":["NTCOMPANYID","VCCOMPANY_NAME","BTACTIVE"],"DATA":[[
    I haven't posted the data of query object.

  • None of the support people speak CF, please help!

    I'm about to write a web service web app. for the 2nd time. I'm new to this but my first app. was a success so I plan to do it again.
    In both cases, the web services weren't written with CF. Not sure what language they used but this shouldn't be a problem as far as I understand because I'm just consuming and CF should be able to do that.
    This time I'm facing an address manipulation software called QAS. This software should be able to do some formating to the input address. For example, if we pass in an address with a mix of lower and uppper case street name, without state and 5 digits zip, after being processed by this software, we'll get a nice formatted address back as a result where the first letter of the street name is capitalized, added the city, state and 9 digits zip with a dash in between. That's briefly what this software can do (it can do more than this but since this software is already there and has this capability, I'm going to use this particular functionality without having to re-invent the wheel).
    In Production env., we should install this software in prod. web server but in dev. stage I can install the software in my local machine, as it is written in its manual. The url to the wsdl file when it is installed in local machine is referred to as http://localhost:2021/Proweb.wsdl The 2021 is the port where this software is installed. I open up in the browser and I can see the wsdl file display nicely.
    Now the problem is, I'm using cfinvoke to invoke this web service as I did in the pass but I got error saying :Web service operation DoBulkSearch with parameters {DoSearch={3300 metzerott rd | adelphi | maryland | 20783},Country={Structure},Engine={Structure},Layout={Database layout}} cannot be found.
    I communicated to the support, even they're helpful but since they don't speak ColdFusion they're not that helpful to me. My last question to them was  asking them to comment on my approach, in a plain english, if the steps I currently use is wrong. Here is my question to them:
    1.       I’m trying to consume (invoke) a web service and reference the WSDL file through http://localhost;2021/Proweb.wsdl
    2.       The method that I’m using to invoke this web service is called: DoBulkSearch
    3.       I also pass a few parameters when invoking this web service and they are:
    ·         Country, which has a value = USA
    ·         Engine  , which has a value = Verification
    ·         Layout ,  which has a value = Database layout
    ·         Search,  which has a value =  1 riverside rd|new york|ny|blank zip
    4.       The end result expected from calling this web service is a formatted address, which steps from this is/are considered in correct. Please
             advice
    This is their answer:
            Engine has to be the structure defined in the wsdl, Verification alone is not enough of a value to pass to it. I don’t know how to pass the   
            structure in coldfusion though.      
            Search has to be a structure as well. If you were to use the DoSearch method, then this string would be enough to pass, it might be easier to
           start with this method.
    In ColdFusion, I tried a couple of approach but unfortunately both are not working and gave the same error:
     <cfinvoke webservice="http://localhost:2021/proweb.wsdl" method="DoBulkSearch" returnvariable="retVal">
     <cfinvokeargument name="Country" value="USA">
     <cfinvokeargument name="Engine" value="Verification">
     <cfinvokeargument name="Layout" value="Database layout">  
    <cfinvokeargument name="Search" value="3223 st. paul street | | | 21218">
    </cfinvoke> <cfdump  var="#retVal#">
    My Question is:
    How can I pass Country, Engine, Search parameters and tell the remote site that these are structure paramater. In cfinvokeargument there is no "Type" attribute where I can write Type= "Structure"
    OR this one is also not working:
    Post / HTTP.1.0
    Content-Type:text/xml
    Content-Length:614
    SOAPAction: "http://www.qas.com/web-2007-08/DoBulkSearch"
    <?xml version="1.0" encoding="utf-8"?><cfsavecontent  variable="soap">
    <cfoutput>   
    <soapenv:Envelope  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">  
    <soapenv:Body>  
    <qas:QABulkSearch xmlns:qas="http://www.qas.com/web-2007-08">
     <qas:Country>USA</qas:Country>
     <qas:Layout>Database layout</qas:Layout>
     <qas:Engine Flatten="1" PromptSet="Default" Intensity="Close">Verification</qas:Engine>
     <qas:BulkSearchTerm>
     <qas:Search>3223 st. paul street | | | 21218</qas:Search>
     </qas:BulkSearchTerm>
     </qas:QABulkSearch>
     </soapenv:Body>
    </soapenv:Envelope>   
    </cfoutput>
    </cfsavecontent> <cfhttp  url="http://localhost:2021/proweb.wsdl/" method="post">  
    <cfhttpparam type="xml" name="DoBulkSearch" value="#trim(soap)#">
    </cfhttp> <cfdump  var="#soap#">
    (screen shot of the wsdl file in text file)

    You pass a structure as a parameter to a web service by making a ColdFusion structure and passing the structure to the web service.  A structure is a complex variable containg a set of key-value pairs.
    Using Arrays and Structures
    http://livedocs.adobe.com/coldfusion/8/htmldocs/arrayStruct_01.html
    A Brief example.
    <cfset search = structNew()>
    <cfset search.key1 = "Value1">
    <cfset search.key2 = 2>
    <cfset search.key3 = "Something Else">
    You would then provide the variable search as the appropiate parameter to your web service.

  • WDDX (de)serializes dateTime with wrong DST rules?

    2006-Aug-20 00:00 is being translated to 2006-Aug-19 23:00.  That date was in Pacific Daylight Time (-7) but the result seems to be -8 (PST).
    I created a Web Service in Lotus Domino 7 and consume it in Coldfusion 8.  I've always returned data to Coldfusion as strings and thought I'd try passing a dateTime.  My Java code uses a kludge to get the ISO8601 date right:
    ("sb_" = java.lang.StringBuffer; "s__" = java.lang.String; "ca_" = java.util.Calendar)
    df_SimpleWddx = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssZ" );
    s__Kludge = df_SimpleWddx.format( ca_Began.getTime() );
    sb_Wddx.append( "<var name='dt_Began'><dateTime>" + s__Kludge.substring( 0, 22 ) + ":" + s__Kludge.substring( 22 ) + "</dateTime></var>" );
    My Coldfusion code:
    ("dx_" = WDDX data; "st_" = Coldfusion structure)
    <cfwddx action="wddx2cfml" input="#dx_BadDates#" output="st_BadDates" />
    <cfdump var="#st_BadDates#" />
    Seeing {ts '2006-08-19 23:00:00'} in <cfdump>, I changed my Java code to:
    sb_Wddx.append( "<var name='dt_Began'><string>" + s__Kludge.substring( 0, 22 ) + ":" + s__Kludge.substring( 22 ) + "</string></var>" );
    and got "2006-08-20T00:00:00-07:00" (which is correct).
    Unless I'm totally lost, Domino (running JVM 1.4.2_11) is sending the date correctly but <cfwddx> isn't turning it into a dateTime correctly.  I'm running the Developer version of Coldfusion (on my local XP machine) and Coldfusion's JVM is 1.6.0_04.
    Has anyone else fought this battle but won?

    Why thank you, cfSearching - that was kind.  Sadly, I am far, far better at code than humor (and my code isn't stellar).
    Paul, a friend showed me a workaround at cflib.org but mine was a little shorter:
    Web Service side ("sb_" = java.lang.StringBuffer; "dt_" = java.util.Date)
    df_Wddx = new java.text.SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssZ" );
    sb_WddxPacket.append( "<var name='s__Begins'> );
    sb_WddxPacket.append( "     <string>" + df_Wddx.format( dt_Begins ) + "</string>" );
    sb_WddxPacket.append( "</var>" );
    return sb_WddxPacket.toString();
    ColdFusion side ("st_" = Structure; "dt_" = DateTime)
    <cfinvoke component      = "WebService"
              returnvariable = "st_WddxPacket"
              ... />
    <cfset df_Wddx   = CreateObject( "java", "java.text.SimpleDateFormat" ) />
    <cfset df_Wddx.applyPattern( "yyyy-MM-dd'T'HH:mm:ssZ" ) />
    <cfset dt_Begins = df_Wddx.parse( st_WddxPacket.s__Begins ) />
    It ignores the colon that's supposed to be in the timezone offset but, since Java is talking to Java, it's OK.
    Thanks for submitting the bug for me!

  • Accessing Array of Structures from Coldfusion

    I am having a problem accessing an array of structures from
    Coldfusion within my flex application. Here is how I make my Array:
    (GetRegions is a type Query and Type is a string variable)
    <cfset ReturnArray = ArrayNew(1)>
    <cfset ReturnArray[1] = StructNew()>
    <cfset ReturnArray[1].Query = GetRegions>
    <cfset ReturnArray[2] = Type>
    Within flex I am trying to access the results in the
    following way:
    private function dataHandler(event:ResultEvent):void{
    Query_Filter = new ArrayCollection(event.result[0].QUERY as
    Array);
    myString = event.result[1] as String;
    Can anybody help me with this. I want a way to return a query
    and a string back from coldfusion.
    Thanks for the help,
    Jeff

    So now I changed my code to the following in CF:
    <cfset Type = "MyString">
    <cfset ReturnArray = ArrayNew(1)>
    <cfset ReturnArray[1] = StructNew()>
    <!--- set up query GetRegions --->
    <cfset ReturnArray[1] = GetRegions>
    <cfset ReturnArray[2] = Type>
    <!--- Return Array --->
    <cfreturn ReturnArray>
    Now in flex I have the following dataHandler Function:
    Alert.show("hello: "+ObjectUtil.toString(event.result[0]));
    Query_Filter = new ArrayCollection(event.result as Array);
    Now I set up a List box with Query_Filter as the dataprovider
    but the results aren't showing correctly. The first item in the
    list box is displayed as [object, Object], [object, Object] and the
    second item is my String.
    Does anybody know how to break up the query to a variable and
    the string to its own variable in the dataHandler function.
    Thanks for any and all help

  • ColdFusion Query and Structures to JSON

    Hello All,
    Please, excuse my self-promotion.
    If you are trying to integrate Spry JSON with ColdFusion then
    try
    toJSON.cfc.
    Hope it helps you.

    Almost there! 
    If I do select -expandproperty results then I just get
    count
      470
    (The data has changed from the above example from 295 page views to 470).
    I don't get any of the other data, which are the % of page views for each browser. 
    However, if I do select -expandproperty performanceStats then I just get
    fileReadCount      : 3
    inspectedCount     : 562
    matchCount         : 470
    processCount       : 3
    fileProcessingTime : 2
    mergeTime          : 0
    ioTime             : 2
    wallClockTime      : 7
    fullCacheHits      : 1
    partialCacheHits   : 0
    cacheMisses        : 0
    cacheSkipped       : 2
    maxInspectedCount  : 297
    minInspectedCount  : 24
    Which appears to be the complete set from the original JSON output. The same is true of metadata:
    eventTypes      : {PageView}
    eventType       : PageView
    openEnded       : True
    beginTime       : 2015-02-09T13:17:14Z
    endTime         : 2015-02-10T13:17:14Z
    beginTimeMillis : 1423487834145
    endTimeMillis   : 1423574234145
    rawSince        : 1 DAYS AGO
    rawUntil        : `now`
    rawCompareWith  :
    guid            : 3c4d61b1-4413-2bd6-ff0f-cf11ed32b687
    routerGuid      : c7cef9c4-c84e-b1a5-618e-5f729be666d3
    contents        : {@{function=alias; alias=Total Page Views; contents=}, @{function=alias; alias=IE; contents=},
                      @{function=alias; alias=Chrome; contents=}, @{function=alias; alias=Firefox; contents=}}
    It's frustrating that it only appears to be these values that are not displaying. 

  • Need help with some Coldfusion data structures

    Hello,
    I need to keep some sort of a list that contains a page, and then that page will have associated with it values.  So,
    if I have page 1, I may have values 240, 245, 300.  Then, on to page 2, and I will have say, 344, 29, etc.
    So, what I will have is something that "could maybe" be a 2 dimensional array where one of the elements is a list?
    Or, do I set up a struct say, page.number and page.value list, and put that struct in an array?
    Plus, the fun part is I have to save this bad boy in session.  I've been looking around the web for some examples, no
    luck.  So, to reiterate:
    I have a page number that has to be associated with a list.  That entire structure needs to be in an array or list of
    some sort, and stored in session.
    Thanks in advance!

    Really Google did not show anything like:
    <cfset session.pageAry = [
         {page="pageOne", numList="240,245,300"},
         {page="pageTwo", numList="344,29"}]>
    <cfdump var="#session.pageAry#">
    OR
    <cfset session.pageAry = arrayNew(1)>
    <cfset arrayAppend(session.pageAry, strutNew())>
    <cfset session.pageAry[1].page = "pageOne">
    <cfset session.pageAry[1].numList = "240,245,300">
    <cfset arrayAppend(session.pageAry, strutNew())>
    <cfset session.pageAry[2].page = "pageTwo">
    <cfset session.pageAry[2].numList = "344,29">
    OR
    The <cfscript> version of these examples.

  • How to get dynamic query results from an array/structure

    I have an edit page that is set up to display phone number fields from the user stored in our database. The properties for the phone number fields are set by a structure of arrays. My problem is that when a user has more than 1 phone number in my database, my structures correctly show this on the form by displaying 2 phone numbers. The problem I am having is that when it shows multiple phone numebrs, it always shows the first result and just repeats it as opposed to dropping the 2nd or 3rd phone number in their respective fields.
    array and structure code below:
          <!--- Mobile --->
          <cfset mobile = StructNew()>
          <cfset mobile.dynamic = false>
          <cfset mobile.dynamicLabel = '+ Add'>
          <cfset mobile.fields = ArrayNew(1)>
    <cfif #checkuserv.recordcount# GT '0'>   
          <cfset mobile.fields[1] = StructNew()>
          <cfset mobile.fields[1].required = false>
          <cfset mobile.fields[1].label = 'Phone Number 1'>
          <cfset mobile.fields[1].displayIcon = false>
          <cfset mobile.fields[1].voice = true>
          <cfset mobile.fields[1].voiceChecked = true>
          <cfset mobile.fields[1].toolTip = "Please choose if you would like to receive a text or voice call on this number">
    </cfif>
    <cfif #checkuserv.recordcount# IS '2'>    
          <cfset mobile.fields[2] = StructNew()>
          <cfset mobile.fields[2].required = false>
          <cfset mobile.fields[2].label = 'Phone Number 2'>
          <cfset mobile.fields[2].displayIcon = false>
          <cfset mobile.fields[2].toolTip = "Please choose if you would like to receive a text or voice call on this number">
          <cfset mobile.fields[2].voice = true>
          <cfset mobile.fields[2].voiceChecked = true>
    </cfif>
    <cfif #checkuserv.recordcount# IS '3'>     
          <cfset mobile.fields[3] = StructNew()>
          <cfset mobile.fields[3].required = false>
          <cfset mobile.fields[3].label = 'Phone Number 3'>
          <cfset mobile.fields[3].displayIcon = false>
          <cfset mobile.fields[3].toolTip = "Please choose if you would like to receive a text or voice call on this number">
          <cfset mobile.fields[3].voice = true>
          <cfset mobile.fields[3].voiceChecked = true>
    </cfif>
    Here is the code for my fields that call the array info:
    <!--- Voice 1 --->      
            <cfloop index="i" from="1" to="#ArrayLen(mobile.fields)#">
                <cfif i EQ 1 OR NOT mobile.dynamic OR form.mobileDisplayed GTE i>
                    <cfparam name="form.areacode_#i#" default="">
                    <cfparam name="form.prefix_#i#" default="">
                    <cfparam name="form.suffix_#i#" default="">
                <div class="fieldBlock phoneBlock" id="phoneBlock#i#">
                    <label for="areacode_#i#">
                        <cfif mobile.fields[i].required><span>*</span></cfif>
                        <cfif mobile.fields[i].displayIcon><img src="/images/sm_phone.jpg" /></cfif>
                        #mobile.fields[i].label#:
                    </label>
                    <div class="inputBlock">
                        <input type="text" maxlength="3" onKeyUp="numTyped(this, 'prefix_#i#', 3, event)" name="areacode_#i#" id="areacode_#i#" class="areacode" value="#trim(left(checkuserv.sub_user_number, '3'))#" />
                        <input type="text" maxlength="3" onKeyUp="numTyped(this, 'suffix_#i#', 3, event)" name="prefix_#i#" id="prefix_#i#" class="prefix" value="#trim(mid(checkuserv.sub_user_number, "4", '3'))#" />
                        <input type="text" maxlength="4" name="suffix_#i#" id="suffix_#i#" class="suffix"  value="#trim(mid(checkuserv.sub_user_number, "7", '4'))#" />
                        <cfif StructKeyExists(mobile.fields[i], "voice") and mobile.fields[i].voice>
                            <div class="voice" id="voice#i#">
                                <input type="radio" value="0" name="voice_#i#"<cfif Not StructKeyExists(mobile.fields[i], "voiceChecked") or Not mobile.fields[i].voiceChecked> checked="checked"</cfif> />
                                <label>Text</label>
                                <input type="radio" value="1" name="voice_#i#"<cfif StructKeyExists(mobile.fields[i], "voiceChecked") and mobile.fields[i].voiceChecked> checked="checked"</cfif> />
                                <label>Voice</label>
                            </div>
                        </cfif>
                        <cfif StructKeyExists(mobile.fields[i], "toolTip") and mobile.fields[i].toolTip neq "">
                            <div class="toolTip" id="toolTip_#i#" title="#mobile.fields[i].toolTip#" onClick="alert('#mobile.fields[i].toolTip#')">?</div>
                        </cfif>
                    </div>
    <!--- This number was invalid or if geocoding failed, and they've picked a carrier to override, display the carrier override dropdown--->
                    <cfif ListFindNoCase(invalidMobileIndexList, i) or ( showMap and IsDefined("form.carrierOverride" & i) )>
                        <div id="carrierOverrideBox#i#" class="carrierOverrideBlock">
                            <label>Carrier:</label>
                            <div class="inputBlock">
                                <select name="carrierOverride#i#" id="carrierOverride#i#">
                                    <option value="-1">-- Pick your carrier --</option>
                                    <cfloop query="carriers">
                                        <!--- 1111 is voice, 0 is NONE, don't display  --->
                                        <cfif Not ListFindNoCase("0,1111", carriers.carrier_id)>
                                            <option value="#Trim(carriers.carrier_id)#"<cfif IsDefined("form.carrierOverride" & i) and form["carrierOverride" & i] eq Trim(carriers.carrier_id)> selected="selected"</cfif>>#Trim(carriers.carrier_title)#</option>
                                        </cfif>
                                    </cfloop>
                                </select>
                                <a href="http://www.inspironlogisticscontact.cfm?account_id=#account_id#&carrierOverride=1"
                                       title="Carrier help"
                                       onClick="window.open('http://www.inspironlogisticscontact.cfm?account_id=#account_id#&carrierOverride=1','#accou nt_id#','width=500,height=800,scrollbars=no,screenX=100,screenY=100,top=100,left=100,resiz able=1'); return false;"
                                      >?</a>
                            </div>
                        </div>
                    </cfif>
                    <cfif mobile.dynamic AND i EQ form.mobileDisplayed AND i LT ArrayLen(mobile.fields)>
                    <div class="dynamicAddBlock dynamicAddMobileBlock" id="dynamicAddmobile_#i#">
                          <a href="javascript: submitAddField('mobile')">#mobile.dynamicLabel#</a>
                    </div>
                    </cfif>
                </div>
                </cfif>
            </cfloop>
            <cfif mobile.dynamic>
                <input name="mobileDisplayed" id="mobileDisplayed" value="#form.mobileDisplayed#" type="hidden" />
            </cfif>
            <input name="carrierOverrideActive" id="carrierOverrideActive" value="<cfif carrierOverrideActive>1<cfelse>0</cfif>" type="hidden" />
    I have been stuck on this for days, finally turning to the forum today with a few different issues. I hate trying to work within the framwork of other peoples code.
    I use coldfusion 8

    I broke the chunk of code away from the page and am now getting teh phone numbers in the right spots, but I am still getting a coldfusion error.
    Element 2 is undefined in a Java object of type class coldfusion.runtime.Array.
    Here is my code...
    <cfset invalidMobileIndexList = "">
    <cfset showMap = false>
    <cfset carrierOverrideActive = false>
    <!--- Voice 1 --->       
            <cfloop index="i" from="1" to="#ArrayLen(mobile.fields)#">
    <!------>            <cfif i EQ 1 OR NOT mobile.dynamic OR form.mobileDisplayed GTE i>
                    <cfparam name="form.areacode_#i#" default="">
                    <cfparam name="form.prefix_#i#" default="">
                    <cfparam name="form.suffix_#i#" default="">
                <div class="fieldBlock phoneBlock" id="phoneBlock#i#">
                <label for="areacode_#i#">
                        <cfif mobile.fields[i].required><span>*</span></cfif>
                        <cfif mobile.fields[i].displayIcon><img src="/images/sm_phone.jpg" /></cfif>
                        #mobile.fields[i].label#:
                    </label>
                    <cfoutput query="checkuserv" ><div class="inputBlock">
                        <input type="text" maxlength="3" onKeyUp="numTyped(this, 'prefix_#i#', 3, event)" name="areacode_#i#" id="areacode_#i#" class="areacode" value="#trim(left(checkuserv.sub_user_number, '3'))#" />
                        <input type="text" maxlength="3" onKeyUp="numTyped(this, 'suffix_#i#', 3, event)" name="prefix_#i#" id="prefix_#i#" class="prefix" value="#trim(mid(checkuserv.sub_user_number, "4", '3'))#" />
                        <input type="text" maxlength="4" name="suffix_#i#" id="suffix_#i#" class="suffix"  value="#trim(mid(checkuserv.sub_user_number, "7", '4'))#" />
                        <cfif StructKeyExists(mobile.fields[i], "voice") and mobile.fields[i].voice>
                            <div class="voice" id="voice#i#">
                                <input type="radio" value="0" name="voice_#i#"<cfif Not StructKeyExists(mobile.fields[i], "voiceChecked") or Not mobile.fields[i].voiceChecked> checked="checked"</cfif> />
                                <label>Text</label>
                                <input type="radio" value="1" name="voice_#i#"<cfif StructKeyExists(mobile.fields[i], "voiceChecked") and mobile.fields[i].voiceChecked> checked="checked"</cfif> />
                                <label>Voice</label>
                        </cfif></div></cfoutput>
                        <cfif StructKeyExists(mobile.fields[i], "toolTip") and mobile.fields[i].toolTip neq "">
                            <div class="toolTip" id="toolTip_#i#" title="#mobile.fields[i].toolTip#" onClick="alert('#mobile.fields[i].toolTip#')">?</div>
                        </cfif>
                    </div>
                    <!--- This number was invalid or if geocoding failed, and they've picked a carrier to override, display the carrier override dropdown--->
                    <cfif ListFindNoCase(invalidMobileIndexList, i) or ( showMap and IsDefined("form.carrierOverride" & i) )>
                        <div id="carrierOverrideBox#i#" class="carrierOverrideBlock">
                            <label>Carrier:</label>
                            <div class="inputBlock">
                                <select name="carrierOverride#i#" id="carrierOverride#i#">
                                    <option value="-1">-- Pick your carrier --</option>
                                    <cfloop query="carriers">
                                        <!--- 1111 is voice, 0 is NONE, don't display  --->
                                        <cfif Not ListFindNoCase("0,1111", carriers.carrier_id)>
                                            <option value="#Trim(carriers.carrier_id)#"<cfif IsDefined("form.carrierOverride" & i) and form["carrierOverride" & i] eq Trim(carriers.carrier_id)> selected="selected"</cfif>>#Trim(carriers.carrier_title)#</option>
                                        </cfif>
                                    </cfloop>
                                </select>
                                <a href="http://www.inspironlogistics.com/wens/contact.cfm?account_id=#account_id#&carrierOverride= 1"
                                       title="Carrier help"
                                       onClick="window.open('http://www.inspironlogistics.com/wens/contact.cfm?account_id=#account_id#&carrierOverride= 1','#account_id#','width=500,height=800,scrollbars=no,screenX=100,screenY=100,top=100,left =100,resizable=1'); return false;"
                                      >?</a>
                            </div>
                        </div>
                    </cfif>
                    <cfif mobile.dynamic AND i EQ form.mobileDisplayed AND i LT ArrayLen(mobile.fields)>
                    <div class="dynamicAddBlock dynamicAddMobileBlock" id="dynamicAddmobile_#i#">
                          <a href="javascript: submitAddField('mobile')">#mobile.dynamicLabel#</a>
                    </div>
                    </cfif>
                </div>
                </cfif>
            <cfif mobile.dynamic>
                <input name="mobileDisplayed" id="mobileDisplayed" value="#form.mobileDisplayed#" type="hidden" />
            </cfif>
            <input name="carrierOverrideActive" id="carrierOverrideActive" value="<cfif carrierOverrideActive>1<cfelse>0</cfif>" type="hidden" /><!------>
           </cfloop>

  • A simple app to secure coldfusion pages - Running into an issue with Session

    Hello, I am testing out how to protect pages in coldfusion and have run into an issue when attempting to create a process by which users can log out.
    Essentially, I have three pages:
    Page A - The form that submits to Page B
    Page B - That checks the form.username and form.password against a database (works fine)
    Page C - Logout page (Which is where I am having an issue).
    Page C throws a "variable Session is undefined" error
    Here is the code on Page C:
    <cfset StructClear(Session)>
    <cflocation url="index.cfm">
    Here is the code on Page B:
    <cfif NOT IsDefined ("form.username")>
    <cflocation url="index.cfm" addtoken="No">
    </cfif>
    <cfquery name="test" datasource="cfdb">
    SELECT * FROM USERS
    WHERE USERNAME = '#FORM.username#'
    AND PASSWORD = '#FORM.password#'
    </cfquery>
    <!---<CFSET Session.LoggedIn = "1">
    <CFSET Session.FirstName = "#test.FirstName#">--->
    <CFIF test.RecordCount IS 0>
    <cflocation url="index.cfm" addtoken="No">
    <CFSET StructClear(Session)>
    <cfelse>
    <CFSET Session.LoggedIn = "1">
    <!---<cflocation url="test.cfm" addtoken="No">--->
    </cfif>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <p><a href="logout.cfm">Log Out</a></p>
    <p> </p>
    <p> </p>
    <p><br>
      This content is protected.
    </p>
    </body>
    </html>
    As you can see, nothing fancy
    Now, I thought that the Session variable could be accessed by any page within a given browser instance, but I am obviously wrong.
    What do I need to do for Page C (my logout page to be able to access the session variable).
    Any guidance is greatly appreciated!

    1.
    “Variable Session is undefined” error comes up when you try to manipulate a session variable which does not exist, as at that point in time. To take care of possible empty session structures, it is good practice to check first if your session is defined.
    So you will have something like:
    <cfif isDefined("session")>
    <cfset StructClear(Session) />
    <cfelse>
    <cflocation url="index.cfm">
    </cfif>
    2.
    To enable you access your session variables from any page in your application, you need to enable session management in your Application.cfm or Application.cfc.
    cfm   <cfapplication sessionmanagement="Yes" />
    cfc        <cfcomponent>
    <cfset THIS.SessionManagement = "Yes" />
    </cfcomponent>
    Reference…http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24 -7c48.html

  • Coldfusion 64 bit windows installer stops working after recent microsoft update

    Coldfusion 64 bit windows installation stops working after recent microsoft updates and how I worked around it.
    My question is at the end.
    Trying to deploy coldfusion 9 enterprise 64 bit trial  version onto a Windows 2003 64 bit datacenter OS with all OS updates from MS (as of 4-7-2011).
    Steps taken (remember, this is all 64 bit):
    1. Installed the base OS which was slipstreamed with SP2.
    2. Checked w/ microsoft and installed 63 OS updates.
    3. Launch the CF9 trial exe.
    4. As soon as the first screen finishes (the one that looks like  it is extracting files) then the second screen pops up (the one that  simply says CF Adobe Coldfusion 9) and the progress bar quickly moves  95% to the right and the install application quits. No error, no nothing. No log file either.
    5. After a moment of incredulous silence (and retrying/rebooting,  etc), I started to google it. I found nothing. However, I did find a  post (thanks dspent!) that was helpful in that it told how he was able  to get at a log file of sorts, by pre-extracting the  coldfusion_9_WWE_win64.exe file and launching the adobe_cf.exe by hand.  (Dspent's install snafu was different than mine, but his post was very  valuable and got me started in the right direction.)
    6. Got a copy of rarunzipper and extracted the coldfusion_9_WWE_win64.exe file.
    7. From the windows directory created by step 6, I launched adobe_cf.exe.
    8. Same thing (the install application quits. No error, no nothing. No log file either.).
    9. I examine the hs_err_pidxxxx.log file (where the xxxx is a number).
    10. I see inside that file an ominous message: "A fatal error has been detected by the Java Runtime" then "Problematic frame ntdll.dll" and then "The crash happened outside the Java Virtual Machine in native code".
    11. OK, so now I am thinking ntdll.dll !! Native code !! It is like Java is telling me that for some reason it can't dance with the OS.
    12. On a hunch, I decided to test a CF install again on a server with just the base install of W3K3 64 SP2 (ie: skipping step 2 above this time).
    13. Bingo! That install works.
    14. Therefore, one of the 63 patches I had downloaded from MS had triggered a problem with the CF installer.
    15. Back on the first server (the one with the MS security  patches installed and the one that CF won't install on). In the CF file  adobe_cf.lax (one of the files extracted in step 6) there is a line that  mentions where the install gets it's java. Find that file, and check java version installer is using. It is using 1.6.0_14-b08.
    16. Off to the Java website, and there is a newer version of java (1.6.0_24-b07). Downloaded and installed it.
    17. Modify a line in adobe_cf.lax :
       before
         lax.nl.current.vm=resource\\jre\\bin\\java.exe
       after
         lax.nl.current.vm=C:\\program files\\java\\jre6\\bin\\java.exe
    (that assumes that you let step 16 install to the default location)
    Save the file.
    18. Run the install ... ** IT WORKS ** !
    Obviously, the built in java provided with the CF installer is  no longer compatible with some change introduced by some recent MS  update on the W2K3 64b SP2 platform.
    And now the interesting part. Although I forced the installer to used the new java, it did not incorporate it into the cf build (ie: in jvm.config, you still see c:/coldfusion9/runtime/jre AND the  version of java.exe that is in that directory is the original version,  not the newer version I forced the installer to use).
    On the surface, CF seems to run OK, but I have not done any application testing yet.
    And finally my
    ** QUESTION **
    Would it be appropriate to simply point the java.home var to the new java directory? I see that the directory structures and files are not exactly the same  (close though) so I certainly don't want to break things by doing this,  but instinct tells me that if the installer broke using the older  version, then something else is gonna break down the road if I don't use  the new version. On the other hand, the differences in the  directories and files is enough that it makes me very nervous, with my  limitied java skill set, to make this decision. 
    Thanks in advance!!
    Byron

    Hi Byron,
    Wow great post no doubt much of the information will be useful for those on Win03 SP2 +. Have to say not come across similar problem on Win08 r2 SP1 +.
    So to your question. Adobe security bulletin (http://kb2.adobe.com/cps/894/cpsid_89440.html) recommends running CF8 and CF9 with JVM 1.6.0_24. The bulletin does not say how to do that. I take you installed JDK and not just JRE 1.6.0_24? Post install of JDK follow these steps:
    Stop CF - SERVICES.msc stop "ColdFusion 9 Application Server".
    Take a copy of CF\runtime\bin\jvm.config - so you got a backup.
    Edit CF\runtime\bin\jvm.config find line "java.home=" and comment it out eg:
    #java.home=C:/ColdFusion9/runtime/jre
    Add new line like so and save jvm.config:
    java.home=C:/Program Files/Java/jdk1.6.0_24/jre
    Note  there the slashes and the location of the JRE (runtime) - you need to  point to the one in JDK because the other JRE in C:\Program  Files\Java\jre6 will be missing a DLL.
    Start CF via SERVICES.msc.
    HTH, Carl.

  • ColdFusion 11 Questions

    I have a few questions about CF 11. I have just installed CF 11 on a Windows 8 server. This
    is an all new server and software installation. It isn’t to where it can be
    viewed outside of our network just yet until we have everything installed and
    running properly on it. When it is all complete we will turn off the current
    server and change the name of this one and make it public. We have the
    certificate on it from the live site. So the name of the certificate and the
    name of the server do not match.I have had my websites on CF 7, CF 8 and CF 9
    servers previously.
    We have used mappings on all of our previous versions with image tags and ahref tags. Have
    things changed in CF 11 to not allow this anymore? An example is <img
    src="/PACTlogin/loginIMages/LoginPicture1.jpg" alt="Login Image"
    />.(/PACTlogin is the mapping) We use the mappings like this because we have
    dynamic pages being built. The same goes for ahref tags. An example of it is <a
    href="/pact/pactacademy/Index.cfm">PACT Academy</a> (/pact
    is the mapping). I have the mapping set up in the administrator just like I
    have used on all previous versions of CF. On CF 11 it says the image is
    missing. When you right click on the image it is actually looking for the image
    in a folder called PACTlogin or pact. Which doesn’t actually exist because it
    is a mapping. The mappings continue to work as expected in CF tags like
    cflocation or cfinclude. What is the work around to get this to work again? Do
    you create an application variable in the Application.cfc and use it in the tag
    like <img src="<cfoutput>#application.Addr#</cfoutput>/login/loginIMages/LoginPicture1.jpg"
    alt="" />? Is there a better way to do this? What are some ideas?
    I have googled lots of things and haven’t come up with much except that CF is being
    used with HTML 5 and since HTML tags like img and ahref are not cf tags it
    doesn’t recognize the link as a mapping as it did before. Is this correct?
    I have taken and created an application variable on Application.cfc and used it in place of
    the mappings and it still isn’t working. An example is <img src="<cfoutput>#application.Addr#</cfoutput>/login/loginIMages/LoginPicture1.jpg"
    alt="login Image" />. Any ideas on why this won’t work either?
    Here is what my page looks like now.
    This is what the page looks like when I go directly to the image in the browser.
    It is totally blank. Not even an X…
    I would appreciate any help or ideas. Thank you in advance.

    If your HTML <IMG> tag is pointing to a normal image (PNG, JPG, GIF, etc...) then ColdFusion is not involved whatsoever.  Only the webserver, IIS, serves images using the code you've entered.  IIS has no idea what your CF Mappings are.  CFLocation and CFInclude, however, are CF tags and so are processed by CF and are aware of the CF mappings.
    What I imagine has happened is your old servers has Virtual Directories defined in IIS that were identical to your CF Mappings.  Compare you directory structures in IIS between your old and new servers to see if this is the case.

Maybe you are looking for