coldfusion

Use SerializeJSON to return an array of structs instead of JSON object with COLUMNS and DATA nodes?

不想你离开。 提交于 2020-01-02 10:28:10
问题 I am building a Railo app which deals with a lot of JSON data sent back and forth via Ajax. I've identified an opportunity to optimize its performance, but I'd like to hear some advice from the community before I tackle it. Here is a good example of the situation. I have an action on the server that queries a set of bid responses, serializes them to JSON, then returns them to my javascript on the front end, which then parses and renders some HTML. The format in which Railo returns the JSON is

Are there different kinds of NULLs?

梦想的初衷 提交于 2020-01-01 13:27:07
问题 This came from <cfquery name="data"> SELECT NULL AS plainNull, CAST(NULL AS datetime) AS Due_Date </cfquery> Are these two different kinds of nulls? What is the difference Note: adapted from How can I call a function in another CFC file from within a query of a function in one cfc file? 回答1: Yes, there is a difference - but not the way you may be thinking. It is not that NULL has a data type per se, one will be associated with it (implicitly or explicitly) as part of evaluating the SQL. With

Implementating Showdown.js markdown parser on the server side for ColdFusion

我的梦境 提交于 2020-01-01 11:37:08
问题 This is a "fact finding" question to see how difficult it would be to create a ColdFusion UDF to parse markdown on the server using the showdown.js parser. There is already a java implementation that utilizes showdown.js (see code at the end of this post) and I want to see how to go about implementing it for ColdFusion. I have no experience in Java and I would not particularly call myself "a programmer," but I don't want this to stop me from trying. Summary I would like to run Shadown.js

checking session timeout when using AJAX

♀尐吖头ヾ 提交于 2020-01-01 09:33:09
问题 I have a ColdFusion page were a user can open a modal and view more information about a row of data. However if the user sits on the page longer than the default 20 minute session timeout, it throws an error because it's looking for the session variables and can't find them. I understand how to trap for this with server side code, but I can't seem to get the AJAX call to successfully determine if the session still exists. Here's the AJAX code that fires when the user hits the button to open

Serious, intermittent errors with CF Web Service

倖福魔咒の 提交于 2020-01-01 08:19:30
问题 We've got an incredibly frustrating situation with a CF Web Services-based API that we wrote and maintain. We had an API in place for years that was stable and working happily with Ruby, PHP, and ColdFusion clients. Then this year a .NET client came along, and we found that our web service was not interoperable with statically-typed languages due to our extensive use of structs. We eventually realized we had to re-write the API without structs, and we've done so. It now uses scaler values,

Passing and returning ColdFusion Structure via JQuery

纵饮孤独 提交于 2020-01-01 05:14:07
问题 I have a ColdFusion session variable that's a structure of data. My goal is to execute a jQuery call that does one of two things via Ajax: sends that ColdFusion structure to a ColdFusion component method, updates an element of that structure with a newly created string, and returns that same structure back. or executes a ColdFusion component method that creates a new string, returns that string, and assigns that new string to an element of that same ColdFusion session structure after the Ajax

Dealing with MySQL NativeError Code 1366 and SQLState HY000 in coldfusion

陌路散爱 提交于 2019-12-31 06:13:34
问题 Please find the initial few lines of stack trace of the error below: (The column sl is what I have used in the stored procedure code) Incorrect string value: '\xC2\x80\xC2\x99t ...' for column 'sl' at row 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946):946 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985):2985 at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631):1631 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723):1723 at com.mysql.jdbc

Coldfusion JSON serialization inconsistency

谁说胖子不能爱 提交于 2019-12-31 05:04:13
问题 I wrote the following component: <cfcomponent> <cffunction name="test" returntype="struct" access="remote" returnformat="json"> <cfset local.str = structNew()> <cfset str.a = "hello"> <cfset str.b = 23> <cfreturn local.str> </cffunction> </cfcomponent> When I run this in my dev environment I get the following: {"A":"hello","B":"23"} In production, I get this: {"A":"hello","B":23} Same code, same CF version, same JVM, different results. Anybody know why? 回答1: It appears that this is bug in CF9

Error while creating validation dropdown in spreadsheet using ColdFusion

对着背影说爱祢 提交于 2019-12-31 04:55:06
问题 I am just creating a validation dropdown in a spreadsheet, from a database query, using ColdFusion. But I am getting the following error "string literals in formulas can't be bigger then 255 character ASCII" Can any one please help to rectify this as I need this functionality urgently. <cfset pop_array = ArrayNew(1)> <cfset provider_name_array = ArrayNew(1)> <h1>Hello</h1> <cfquery name="qryGetPOP" datasource="webalc"> select distinct center_code from alc_pop<!--- where rownum<=10 ---> <

How can I display each days events?

六月ゝ 毕业季﹏ 提交于 2019-12-31 04:14:10
问题 I have an events page where I need to display the events for each day. I've gotten it to this point, so I'm making progress. The database has 3 tables: fairdays, eventtypes, events fairdays: id, fairdaydate (datetime), daycolor, description eventtypes: id, eventtype <-- This table is for the input select in the "add event form" events: id, eventname, eventtype, eventday (datetime), eventtime (datetime) My intent is to display the day with the description, then under that is the event types,