Skip to main content
Inspiring
April 8, 2009
Question

Whitespace issue.

  • April 8, 2009
  • 2 replies
  • 957 views

Has anyone experience the problem similar to below.

<cfquery name="getSomething" datasource="ds">

     SELECT 'test' test1

     FROM DUAL

</cfquery>

<cfoutput>

     aaa#getSomething.test1#aa

</cfoutput>

result is:

aaatest     aa

Notices the whitespace which is variable. The problem only occurred at one of our client machine which we don't have any controlled of.

I even surround it with csilent but nothing fix. I can trim as a temporary solution but need to find the cause so it could be prevented in the future. What puzzle me is it working fine at our dev and quality environment but not at our client environment.

This topic has been closed for replies.

2 replies

ilssac
Inspiring
April 8, 2009

As well as the cfadmin white space management setting, the <cfprocessingDirective...> tag and the <cfsilent...> block, don't forget there is also the <cfsetting enableCFOutputOnly="true"> that can be used to control whitespace.

With this option only content inside of <cfoutput>...<cfoutput> block get rendered to the client response.

April 8, 2009

Are you using <cfprocessingdirective suppressWhiteSpace="yes"> already?

john85Author
Inspiring
April 8, 2009

Did set the Enable Whitespace Management, shouldn't that supercede the <cfprocessingdirective suppressWhiteSpace="yes">..?

April 8, 2009

I can't recall offhand, but I checked my dev CF8 server's settings, and find whitespace management is enabled.  Still, I use <cfprocessingdirective suppressWhiteSpace="yes"> in my templates invoked via AJAX, because if I recall there still was extraneous whitespace.  No harm in trying.