REQUEST, URL, FORM, OH MY!

276 views
Skip to first unread message

Mark Drew

unread,
Feb 9, 2015, 10:15:23 AM2/9/15
to Lu...@googlegroups.com
A feature suggestion for lucee would be to be able to put all the scopes and things already into the Request scope. It’s an odd scope I guess as from my point of view it should contain things like the URL, FORM, HEADERS, COOKIES in it so you can see what is in it instead of relying on random functions.

What do people think in having (pre-populated):

Request.FORM -> FORM
Request.URL -> URL
Request.HEADER -> getHTTPRequestData()
Request.COOKIE -> COOKIES

It seems (maybe just to me) but that is the correct place for these things?

MD

Adam Cameron

unread,
Feb 9, 2015, 10:28:11 AM2/9/15
to lu...@googlegroups.com
Yup, do it!

-- 
Adam


MD

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/7DCC2177-E782-4DAA-86B7-5D7F4361A3BC%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Mark Drew

unread,
Feb 9, 2015, 10:32:03 AM2/9/15
to lu...@googlegroups.com
Err… you mean , should I raise a feature request in the JIRA after proper community conversation and consultation ?
MD

Ryan Guill

unread,
Feb 9, 2015, 10:41:08 AM2/9/15
to lu...@googlegroups.com, Lu...@googlegroups.com
im for that, and also unioning the form and url scope variables directly into the request scope.  that way you could access them easier for the 99% use case of the two not overlapping, but still get at the variables in the proper place if you need to make the distinction. 

I'd also like to see it shortened to req, but thats personal preference.

Adam Cameron

unread,
Feb 9, 2015, 10:58:14 AM2/9/15
to lu...@googlegroups.com
No, f*** it... I'm me, not Micha!

I DEMAND YOU DO IT. AND I DEMAND YOU DO IT NOW!!!!!

(my £500)

-- 
Adam

Dave Merrill

unread,
Feb 9, 2015, 11:30:06 AM2/9/15
to lu...@googlegroups.com, Lu...@googlegroups.com
Makes sense to me on a gut level, but you can already do that in Application.cfc, if that's your preference, and clear the original scopes too.

Mark Drew

unread,
Feb 9, 2015, 11:31:56 AM2/9/15
to lu...@googlegroups.com
Yarp. It is totally do able but I am thinking of explaining Lucee to  newbee and having a properly filled request scope makes sense to me. 

MD 

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Mark Drew

unread,
Feb 9, 2015, 11:32:12 AM2/9/15
to lu...@googlegroups.com
For £500 I WILL DO IT! 

MD 

Adam Cameron

unread,
Feb 9, 2015, 11:35:17 AM2/9/15
to lu...@googlegroups.com
What are we talking about now?

Carl Von Stetten

unread,
Feb 9, 2015, 11:59:43 AM2/9/15
to lu...@googlegroups.com
What is the impact on all the frameworks out there that already combine the FORM and URL stuff into an "rc" variable (FW/1, ColdBox, etc.)?  And would adding HEADER and COOKIE add a bunch of cruft to the request scope that many folks will never (or almost never) use?
-Carl V.

Jonas Hauß

unread,
Feb 9, 2015, 12:15:06 PM2/9/15
to lu...@googlegroups.com
+1

Dominic Watson

unread,
Feb 9, 2015, 6:24:16 PM2/9/15
to lu...@googlegroups.com
I've always treated the request scope as a scope for variables that are request specific, but *not* provided by external input. Much as PRC is designed for use in ColdBox (and others).

I think it makes perfect sense that way and wouldn't be a fan of changing it.

On 9 February 2015 at 17:15, Jonas Hauß <hauss...@gmail.com> wrote:
+1


--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Pixl8 Interactive, 3 Tun Yard, Peardon Street, London
SW8 3HT, United Kingdom

T: +44 [0] 845 260 0726 W: www.pixl8.co.uk E: in...@pixl8.co.uk

Follow us on: Facebook Twitter LinkedIn
CONFIDENTIAL AND PRIVILEGED - This e-mail and any attachment is intended solely for the addressee, is strictly confidential and may also be subject to legal, professional or other privilege or may be protected by work product immunity or other legal rules. If you are not the addressee please do not read, print, re-transmit, store or act in reliance on it or any attachments. Instead, please email it back to the sender and then immediately permanently delete it. Pixl8 Interactive Ltd Registered in England. Registered number: 04336501. Registered office: 8 Spur Road, Cosham, Portsmouth, Hampshire, PO6 3EB

Adam Cameron

unread,
Feb 9, 2015, 6:31:28 PM2/9/15
to lu...@googlegroups.com
That's *kinda* "let's pretend it's something other than what it's name suggests... you know... *because*". Which is the same rationale I've heard from *everyone* who has an opinion on it.

I think the request scope has been a white elephant since CF5, and it makes sense to "reclaim" it to be something more along the lines that the HTTP spec suggests it might be intended for.

-- 
Adam


Patrick Heppler

unread,
Feb 10, 2015, 4:50:52 AM2/10/15
to lu...@googlegroups.com, Lu...@googlegroups.com
+1 for unioning form and url. I already use this in my OnRequestStart()
structAppend(request, url, false);
structAppend(request, form, true);

Dominic Watson

unread,
Feb 10, 2015, 4:54:54 AM2/10/15
to lu...@googlegroups.com
No it's not. At all. REQUEST - a scope for storing variables that are specific to, and should stick around for the life of, the REQUEST. That is its intention that I have understood since my very first day with CFML. Having a distinction for the various forms of request *input* is useful. Mixing them into one for your application trivial via Struct append, request.append(), etc.

I'm not dead against having the other scopes mixed in to the request (certainly for it as a feature flag), but I feel that the language would lose some precision by enforcing it and to no great benefit.


For more options, visit https://groups.google.com/d/optout.

Mark Drew

unread,
Feb 10, 2015, 5:01:21 AM2/10/15
to lu...@googlegroups.com
OK then can we have a HEADERS scope then rather than explicitly trying to get them with getHTTPRequestData() and for consistency can we then have getHTTPQueryData() and getHTTPPostData() ?

MD

Dominic Watson

unread,
Feb 10, 2015, 5:10:06 AM2/10/15
to lu...@googlegroups.com
> OK then can we have a HEADERS scope then rather than explicitly trying to get them with getHTTPRequestData() and for consistency can we then
have getHTTPQueryData() and getHTTPPostData() ?

+1


For more options, visit https://groups.google.com/d/optout.

Dominic Watson

unread,
Feb 10, 2015, 5:49:54 AM2/10/15
to lu...@googlegroups.com
Further to the REQUEST / URL / FORM discussion, I have often thought that the URL and FORM scopes should be read only as is the case with CGI. i.e. you can't change the past. The same could also be said for the ARGUMENTS scope.

Thinking about it further, scopes themselves could then be divided into two categories, reference and storage:

Reference: URL, FORM, CGI, ARGUMENTS
Storage: SERVER, APPLICATION, SESSION, COOKIE, CLIENT, REQUEST, VARIABLES, LOCAL, THREAD...

Of course, this would break a lot of code and not something that could be implemented lightly (should anyone actually agree).

Cameron Childress

unread,
Feb 10, 2015, 6:07:30 PM2/10/15
to lu...@googlegroups.com
On Mon, Feb 9, 2015 at 10:15 AM, Mark Drew wrote:
It seems (maybe just to me) but that is the correct place for these things?

I kinda like having the flexibility to do what I want to the URL and FORM scope. Too many codebases already use request scope for something meaningful. I am all for breaking backwards compatibility when it makes sense but this feels like changing things just to be changing them. Besides if you want to stuff them all into the request scope you can already so that if you want wish very few lines of code.

Most frameworks have combined URL and FORM scopes since way back in FB days, but there are valid reasons for having them separate sometimes too.

There are so many other more worthy candidates for change.

-Cameron
 
--
Cameron Childress
--
p:   678.637.5072
im: cameroncf

mike...@gmail.com

unread,
Mar 5, 2015, 4:06:46 PM3/5/15
to lu...@googlegroups.com, Lu...@googlegroups.com
I disagree. The scopes are organized more effectively now, separating external input and purposes clearly. I explicitly use the Request scope for variables that need to exist for the life of the request as a result of the application. Making two ways to access the request scope as a standard of the language seems unnecessary and potentially confusing, while it provides no direct convenience, performance, or other gain as far as I can see from your description.
Mike


On Monday, February 9, 2015 at 9:15:23 AM UTC-6, Mark Drew wrote:

mike...@gmail.com

unread,
Mar 5, 2015, 5:50:13 PM3/5/15
to lu...@googlegroups.com, Lu...@googlegroups.com
Small edit... I meant to say "Making two ways to access the other scopes...."

Sorry for any confusion.
Reply all
Reply to author
Forward
0 new messages