Thursday, July 15, 2010

Null chekcing is not workig properly in CF8

My variable and value is coming along with list of variables. I tried to check the variable conditions like
"<"cfif variablename) eq "" ">"
"<"cfset variablename = "New" ">"
"<"/cfif">"
But this condition not at all checking. Then i used below len() function.

Use below condition to check variable nulls in cf8
"<"cfif len(variablename) eq 0 ">"
"<"cfset variablename = "New" ">"
"<"/cfif">"

Monday, February 2, 2009

ColdFusion Updates/Hotfixes

Check below link to get cf updates/Hotfixes
1. http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_17883
2. http://kb.adobe.com/selfservice/viewContent.do?externalId=42dcb10a&sliceId=1

Thanks

HTTP Compression with ColdFusion

Compressing Content Using a Servlet Filter:
Compression is a process that reduces the number of bytes required to define a document in order to save disk space or transmission time. It is extremely useful for sending information across the web, because the speed at which people receive information from a web application is dependent upon how much data you are trying to send. The smaller the amount of information that is to be sent, the faster it can be sent. Therefore, compression and the associated responsiveness is a key component to retaining users and generating revenue from those retained users.
Compression can be effectively achieved by having a servlet filter conditionally pipe the produced content to a GZip-compressed file. GZip is supported by the HTTP protocol and almost all modern browsers (hence the servlet filter conditionally compresses the content).
GZip compression usually results in a 6:1 compression ratio, although this depends on how much content is being sent and what the content is.
Setting up the Servlet Filter in ColdFusion
Using the ColdBeans servlet filter found at the following URL:
http://www.servletsuite.com/servlets/gzipflt.htm
1.Download the GZipFilter.jar
2.Save GZipFilter.jar in the WEB-INF/lib folder in the ColdFusion Server wwwroot.
3.Edit the web.xml file in the WEB-INF folder in the ColdFusion Server wwwroot with the following code:

"<"filter>
"<"filter-name>GzipFilter"<"/filter-name>
"<"filter-class>com.cj.gzipflt.GzipFilter"<"/filter-class>
"<"/filter>
"<"filter-mapping>
"<"filter-name>GzipFilter"<"/filter-name>
"<"url-pattern>*.cfm"<"/url-pattern>
"<"/filter-mapping>

4.Restart the ColdFusion Service
Now, when you invoke any .cfm page the GzipFilter will check out client’s browser settings. If the browser does not support gzip, the filter invokes resource normally. If the browser does support gzip, output will be compressed.

Note: Link for more details http://www.simonwhatley.co.uk/poor-mans-http-compression-with-coldfusion

~Thanks
Mohan

"<"cfloop query="GetRecords"> is not working properly

Issue: "<"cfloop query="GetRecords"> is not working properly

Snippet:

"<"cfloop query="GetRecords">
"<"cfset myid = Id >
"<"cfset myname = Name >
"<"/cfloop>

Solution: we have to get the data using query name
like Quername.fieldname, while iterating querydata.

Snippet:

"<"cfloop query="GetRecords" >
"<"cfset myid = GetRecords.Id >
"<"cfset myname = GetRecords.Name >
"<"/cfloop >

~Thanks
Unnam

ValueList() function returns decimal numbers error in Coldfusion 6.1

Error: ValueList() function returns decimal numbers instead of Integers in Coldfusion 6.1
Solution: To fix this issue in ColdFusion 6.1,download
macromedia drivers from the below any one link and copy the
latest macromedia_drivers.jar file and paste it in the below "\CFusionMX\lib" path. After that restart the Coldfusion Application server.
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_17883
(or)
http://kb.adobe.com/selfservice/viewContent.do?externalId=42dcb10a&sliceId=1

~Thanks
Unnam