Search code examples
javacoldfusioncoldfusion-10cfml

Cfscript and dynamic values


I have a custom class written in java which works fine if I use hard coded data but I would like to get the data from the URL instead of hard coded

<cfscript>
   scraper = createObject("java", "AccessOS2Scraper");
   foo     = scraper.getText( "web", "2014", "https://access.acme.com/AsrDisplay.do?asrno=1432310020&icsc=SW11");
</cfscript>

My syntax is, user = web, passwd = 2014 and url = https://....

So I would like to call my page something like that

http://myserver.domain.com/mytest.cfm?user=web&passwd=2014=url=https://https://access.acme.com/AsrDisplay.do?..

How can I access these elements inside the cfscript?


Solution

  • You may reference the variables via the URL scope in CF. You may want to wrap the values with JavaCast() and cast the value into the right type, just in case.