passing parameters via SES urls

0 views
Skip to first unread message

david....@gmail.com

unread,
Jun 10, 2008, 10:32:27 PM6/10/08
to Mach-II for ColdFusion
http://www.site.com/appfolder/index.cfm/e/user.account.reminder/email/em...@email.com

I have the properties set in my mach-ii.xml
<property name="urlDelimiters" value="/|/|/" />

<property name="urlBase" value="/MNMNT_0809/index.cfm" />
<property name="urlParseSES" value="true" />

How come it can't read the email parameter?

david....@gmail.com

unread,
Jun 11, 2008, 12:32:08 AM6/11/08
to Mach-II for ColdFusion
<cfscript>
pathInfo = reReplaceNoCase(trim(cgi.path_info), '.+\.cfm/? *', '');
i = 1;
lastKey = "";
value = "";
if(len(pathInfo)){
for(i=1; i lte listLen(pathInfo, "/"); i=i+1) {
value = listGetAt(pathInfo, i, "/");
if(i mod 2 is 0) url[lastKey] = value;
else lastKey = value;
}
if((i-1) mod 2 is 1) url[lastKey] = "";
IF(NOT IsDefined(lastKey)) lastkey = url[lastKey];
}
</cfscript>

i just stuck this in my application.cfm file. it seemed to work...

Peter J. Farrell

unread,
Jun 11, 2008, 12:50:17 AM6/11/08
to mach-ii-for...@googlegroups.com
Your original message doesn't really explain the problem you are having.  What you doing exactly and why is it not working as you expect?

I tried a url with similar syntax and I can call event.getArg("email") and have it return the email address as expected without adding the code you pasted below.

.peter

david....@gmail.com said the following on 6/10/2008 11:32 PM:

david....@gmail.com

unread,
Jun 11, 2008, 1:47:40 AM6/11/08
to Mach-II for ColdFusion
I had originally been using cfparams throughout my code for url
parameters.
I had to use that code in the application file to keep it that way to
read the url parameters without changing the rest of my code.\
I still have a lot to learn in terms of event calls like that...
Thanks!
Dave

On Jun 11, 12:50 am, "Peter J. Farrell" <pe...@mach-ii.com> wrote:
> Your original message doesn't really explain the problem you are
> having. What you doing exactly and why is it not working as you expect?
>
> I tried a url with similar syntax and I can call event.getArg("email")
> and have it return the email address as expected without adding the code
> you pasted below.
>
> .peter
>
> david.d.t...@gmail.com said the following on 6/10/2008 11:32 PM:

Peter J. Farrell

unread,
Jun 11, 2008, 2:32:30 AM6/11/08
to mach-ii-for...@googlegroups.com
FYI, All url and form params are put into the event object for you:
http://greatbiztoolsllc-trac.cvsdude.com/mach-ii/wiki/AnatomyOfMachIIPart2#BuildingtheEventObject

You can optionally use a second argument to denote a default value if the "email" arg does not exist or you could check using event.isArgDefined("email") instead.

event.getArg("email", "defaultvalue")

.peter

david....@gmail.com said the following on 6/11/2008 12:47 AM:

Dave Tran

unread,
Jun 11, 2008, 2:44:52 AM6/11/08
to mach-ii-for...@googlegroups.com
Ahhh okay.
I really appreciate the feedback...
I'm about halfway through streamlining this framework that I have so it's totally portable. I have a lot to learn still.

Are there any good read ups on Beans?  I know there are code generators out there to create Beans, but I still need to look up on them, on how they are created, and called, so I can utilize them.
Thanks again for all of your help...
Dave
--
Reply all
Reply to author
Forward
0 new messages