Syntax for <cfsetting showdebugoutput="false" /> in cfscript on Railo?

788 views
Skip to first unread message

Thorsten Eilers

unread,
Aug 31, 2012, 3:00:12 AM8/31/12
to ra...@googlegroups.com
Morning,
what is the correct syntax for <cfsetting showdebugoutput="false" />  in cfscript on Railo?
http://wiki.getrailo.org/wiki/TAG:CFSETTING
says
<cfscript>
  setting
	[enablecfoutputonly="any"]
	[requesttimeout="number"]
	[showdebugoutput="boolean"] {
}
</cfscript>

I can't get it to work.

Regards
Thorsten

Igal

unread,
Aug 31, 2012, 3:14:49 AM8/31/12
to ra...@googlegroups.com
I didn't test it, but try:

   setting( requestTimeout=300, enableCfoutputOnly=true );

Thorsten Eilers

unread,
Aug 31, 2012, 3:26:13 AM8/31/12
to ra...@googlegroups.com

Hi Igal thanks for your try:
setting( requestTimeout=300, enableCfoutputOnly=true );
gives
No matching Method/Function [SETTING] for call with named arguments found

Mark Drew

unread,
Aug 31, 2012, 3:31:02 AM8/31/12
to ra...@googlegroups.com
Have you tried:

setting requestTimeout="300" enableCfoutputOnly="true";


Regards
Mark Drew

Igal @ getRailo.org

unread,
Aug 31, 2012, 3:36:34 AM8/31/12
to ra...@googlegroups.com
try Mark's suggestion (it should work). if not -- you can always use
Java reflection even though it's not ideal but it will get the job done,
e.g.

setting = createObject( 'java', 'railo.runtime.tag.Setting' );

setting.setRequesttimeout( 300 );

setting.setShowdebugoutput( true );

setting.setEnablecfoutputonly( true );
--
Igal Sapir
Railo - Open Source CFML Engine
http://getrailo.org

Michael Offner

unread,
Aug 31, 2012, 3:48:54 AM8/31/12
to ra...@googlegroups.com
it works like mark has written, the "[]" in the syntax pattern mean
that this attributes are optional, you have to remove them in your
code.

/micha

2012/8/31, Igal @ getRailo.org <ig...@getrailo.org>:
--
/micha

Michael Offner CTO Railo Technologies GmbH

Adam Cameron

unread,
Aug 31, 2012, 4:02:44 AM8/31/12
to ra...@googlegroups.com
This worked for me on 4.0.0.013

Igal

unread,
Aug 31, 2012, 4:18:07 AM8/31/12
to ra...@googlegroups.com
@Micha -- is there a "rule" to which tags go in the format:

   setting requestTimeout=300;

      and which goes in the format:

   dump( var=myVar );

Michael Offner

unread,
Aug 31, 2012, 4:37:31 AM8/31/12
to ra...@googlegroups.com
syntax for tags in script is always the same, "dump" in script is a
function not a tag, the reason for this is very simple, the function
has exist long before tags was supported in script.
the tag "dump" is not supported in cfscript, because there is already
a function for it. we could add support for the tag as well, so you
can write
dump(x);
or
dump var="#x#";

but i think the function syntax is more handy in this cae.

/micha

2012/8/31, Igal <ig...@getrailo.org>:
> @Micha -- is there a "rule" to which tags go in the format:
>
> setting requestTimeout=300;
>
> and which goes in the format:
>
> dump( var=myVar );
>
>
>
> On Friday, August 31, 2012 12:48:57 AM UTC-7, Michael Offner wrote:
>>
>> it works like mark has written, the "[]" in the syntax pattern mean
>> that this attributes are optional, you have to remove them in your
>> code.
>>
>> /micha
>>
>> 2012/8/31, Igal @ getRailo.org <ig...@getrailo.org <javascript:>>:
>> > try Mark's suggestion (it should work). if not -- you can always use
>> > Java reflection even though it's not ideal but it will get the job done,
>> >
>> > e.g.
>> >
>> > setting = createObject( 'java', 'railo.runtime.tag.Setting' );
>> >
>> > setting.setRequesttimeout( 300 );
>> >
>> > setting.setShowdebugoutput( true );
>> >
>> > setting.setEnablecfoutputonly( true );
>> >
>> >
>> >
>> > On 8/31/2012 12:31 AM, Mark Drew wrote:
>> >> Have you tried:
>> >>
>> >> setting requestTimeout="300" enableCfoutputOnly="true";
>> >>
>> >>
>> >> Regards
>> >> Mark Drew
>> >>
>> >> On 31 Aug 2012, at 08:26, Thorsten Eilers
>> >> <thorste...@googlemail.com<javascript:>>

Thorsten Eilers

unread,
Aug 31, 2012, 4:41:30 AM8/31/12
to ra...@googlegroups.com
Thanks to all.
This is doing the trick.

setting showdebugoutput="no";

Igal @ getRailo.org

unread,
Aug 31, 2012, 5:04:26 AM8/31/12
to ra...@googlegroups.com
I personally like the "function" style better. I think that it was also
the case for trace( ) and/or log( ). the problem is that when there are
inconsistencies then we need to "remember" more things.

is there a list of functions in cfscript somewhere that we can use as
reference? if there's no list but you can point me to a package or an
interface in the source (or even a pattern to look for), that would be
good enough.

thanks,


Igal

Adam Cameron

unread,
Aug 31, 2012, 5:10:02 AM8/31/12
to ra...@googlegroups.com


On Friday, August 31, 2012 10:04:39 AM UTC+1, Igal wrote:
I personally like the "function" style better.

Agreed.  I wish all these things had been implemented as functionality(arg, arg, etc), instead of this weirdo "tags with no angle brackets" style.  It seems like one needs to guess whether the language developer threw heads or tails when deciding which approach they'd take with some given functionality sometimes.

It really  makes CFML look like it can't make up its mind what it is.

(this is not an indictment of Railo, the same applies to - and I guess stems from - CF).

--
Adam

Mark Drew

unread,
Aug 31, 2012, 5:16:15 AM8/31/12
to ra...@googlegroups.com
OK, 
The deal is that you can use MOST of the tags without the <cf > 

a lot of functions have been implemented that match the tags, but of  course, there could be a few that haven't. It is HARD to make language syntax decisions and this was a good shortcut to get all the tags into script. 

Maybe we should have just not done it and you can then drop out to tags to do it instead? which I wouldn't like. 

I am not sure if it is your style of emailing, but you seem to critique the efforts of an Open Source project all the time. How about you go and spend time implementing all the tags that are missing as functions?

Or if not, at least make a list of the ones that are missing? Or make constructive suggestions rather than just slag our efforts off. 



Mark Drew
 
Railo Technologies Professional Open Source
skype: mark_railo ma...@getrailo.com
+44 7971 852296 http://www.getrailo.com

Michael Offner

unread,
Aug 31, 2012, 5:45:37 AM8/31/12
to ra...@googlegroups.com
function style is only working for tags with no body. take as example
mail,query,loop ...
you cannot display them in function style.

example:
loop query="qry" {

}

/micha



2012/8/31, Adam Cameron <adamcamero...@gmail.com>:
>
>
> On Friday, August 31, 2012 10:04:39 AM UTC+1, Igal wrote:
>>
>> I personally like the "function" style better.
>>
>
> Agreed. I wish *all *these things had been implemented as
> functionality(arg, arg, etc), instead of this weirdo "tags with no angle
> brackets" style. It seems like one needs to guess whether the language
> developer threw heads or tails when deciding which approach they'd take
> with some given functionality sometimes.
>
> It really makes CFML look like it can't make up its mind what it is.
>
> (this is not an indictment of Railo, the same applies to - and I guess
> stems from - CF).
>
> --
> Adam
>


Adam Cameron

unread,
Sep 3, 2012, 8:16:59 AM9/3/12
to ra...@googlegroups.com


On Friday, August 31, 2012 10:16:20 AM UTC+1, Mark Drew wrote:

The deal is that you can use MOST of the tags without the <cf > 

a lot of functions have been implemented that match the tags, but of  course, there could be a few that haven't. It is HARD to make language syntax decisions and this was a good shortcut to get all the tags into script. 


Yeah, I get it.  My point was more that I wish that this hadn't been the approach taken.  Taking tag syntax and simply lopping off the "<cf" and the ">" is not a great solution for implementing the functionality in a "script-style" language, IMO.  As Joe Reinhart said in his video (paraphrase) "that's not script, it's just a tag without angle brackets".  I agree with this.  And I will repeat - because you seemed to have missed me saying this the previous time - this is not a slight on Railo, it's a slight on Adobe and a slight on the CFML language... Adobe started it after all.  It makes sense that Railo follows this precedent (better than having yet another precedent, after all!).  However equally I think my observation - having been in this game for a reasonable length of time - is not invalid simply because it states something contrary to how you (and you seem to be taking it personally) have implemented something.

I do, sincerely, wish that we didn't have this:

param name="foo" default="bar";

But we had this:

foo = param("foo", "bar");

Or instead of:

include "foo.cfm"; // note that param specifies the attributes, include does not...

to have:

include("foo.cfm");

[etc]

I'm entitled to this opinion, Mark, and it's actually - I think - an entirely reasonable one.

 
Maybe we should have just not done it and you can then drop out to tags to do it instead? which I wouldn't like. 

I am not sure if it is your style of emailing, but you seem to critique the efforts of an Open Source project all the time. How about you go and spend time implementing all the tags that are missing as functions?


Both those statements are a bit facile, Mark.  The latter one smacks of what one sees on movie forums when someone offers a bad review of someone else's favourite movie, and they respond with "well let's see if you can do better!"  It's just false logic.  One can observe (what they perceive to be ~) shortcoming in a product without being in the position to remedy it.  For my part, I am a good CF developer (I think), but I'm a lousy Java developer.  I need the docs beside me to even write "HelloWorld.java" (that is an overstatement, but not by much).  And, to be frank, I simply don't have time to work on yet another project.  Also bear in mind - and whether this makes it "better" or "worse" - I'm not even a user of Railo, however I am a user of CFML so I like to stay involved with the various communities that have influence on CFML.  You've all got a cracking good project, and I wish you well, but at the end of the day I'm personally not that specifically interested in Railo.  I've nothing against it, but I've no vested interest in it.  I will however help out where I can.

Now I have drawn your (collective) attention to a few things I've discovered that are either anomalous or broken, and I will engage in discussions about [stuff] to do with CFML.  The only reason I do this is to help you guys make a better product.

 
Or if not, at least make a list of the ones that are missing? Or make constructive suggestions

Almost everything I have posted on this forum has been advising you guys where I've found stuff that's not quite right, and have continued the discussion of the same.  This is constructive.

 
 rather than just slag our efforts off. 


I didn't do that though, did I, Mark?  Indeed I specifically said that I was not making that comment as an indictment of Railo per se.

But even if it was directed whole-heartedly at not only Railo, but at your own specific work: if I come to make a statement "It seems like one needs to guess whether the language developer threw heads or tails when deciding which approach they'd take with some given functionality sometimes" it might be worth stopping to think why I might have said that, and if you can't see where I'm coming from, then ask me to clarify.  I probably will have a reason for saying what I say, after all.  Don't just have a go at me.  "Play the ball, not the player" as it were.

Cheers.

--
Adam

Jean Moniatte

unread,
Sep 3, 2012, 8:27:57 AM9/3/12
to ra...@googlegroups.com
Hello,

Taking the "extra" stuff aside, I have to say that I agree with the fact that the some of cfscript implementation is not as good as it could be. The include and param are perfect examples.

Mark: would it be possible for Railo to support both syntaxes? How can we help?

Thanks,
Jean
--
Jean Moniatte
UGAL

Adam Cameron

unread,
Sep 3, 2012, 8:30:12 AM9/3/12
to ra...@googlegroups.com
Hi micha

Taking your query loop example, why could it not be:

for (row in query){ // where "row" is either the "currentRow" variable, or the entire row?
}

or

for ({index,row} in query){  // capture both discretely

}

But, yeah, there are other examples wherein to get the thing into "function style" syntax and preserve the nestability of the tag equivalent gets a bit torturous, eg:

q = new query("dsn") {
   // some way of expressing both the SQL and the params here
}

What I more meant is stuff like this;

throw "message";
throw(message, type, detail, code, extended);

include "foo.cfm";
but not:
include template="foo.cfm";
or:
include("foo.cfm);

abort "error";
not:
abort("error);

Or how CF has got this godawful approach to doing stuff like <cfquery> and <cfmail> as CFCs, rather than as native implementations.  What's that all about (dunno if Railo does the same here).

I'd expect to just do this:

q = query(dsn, sql, params, [etc]);

Stuff like that.  I don't think there's a great deal of consistency, and I think that let's CFML down a bit.  And - like I said - I'm not targeting Railo or the developers thereof when I say this, it's just an observation and an opinion.

Cheers.

--
Adam
Reply all
Reply to author
Forward
0 new messages