• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Whitespace issue.

Explorer ,
Apr 08, 2009 Apr 08, 2009

Copy link to clipboard

Copied

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.

TOPICS
Advanced techniques

Views

815

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 08, 2009 Apr 08, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 08, 2009 Apr 08, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 08, 2009 Apr 08, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 08, 2009 Apr 08, 2009

Copy link to clipboard

Copied

I have no problem trying, it is just that I don't have the leverage to tell the client try this and that. Can't really test on our environment since it is working fine. I just don't get how a SELECT statement would generate random amount of whitespace.

I guess I should quitely try <cfprocessingdirective suppressWhiteSpace="yes"> in the future. For now, a bunch of wastefull TRIM...

Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Apr 08, 2009 Apr 08, 2009

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation