This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| public string function getPathPart(string uri) { | |
| var pathPart = ""; | |
| var doubleSlashPos = find("//", arguments.uri); | |
| if (doubleSlashPos == 0) { | |
| pathPart = arguments.uri; | |
| } else if (doubleSlashPos == 1) { | |
| // remove protocol (//) | |
| pathPart = right(arguments.uri, len(arguments.uri) - 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| public string function appendPath( | |
| required string baseUri, | |
| required string path, | |
| boolean ensureLeadingSlash = false, | |
| boolean ensureTrailingSlash = false | |
| ) { | |
| // Protocols for absolute URLs | |
| var protocolPattern = "^(https?:|ftps?:|ws:|wss:|file:|mailto:|data:|//)"; | |
| var isAbsolute = reFindNoCase(protocolPattern, arguments.path) > 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| pathPart = "/a"; | |
| baseUri = "https://www.orf.at/path/"; | |
| /* | |
| pattern = createObject("java", "java.util.regex.Pattern"); | |
| pattern = pattern.Compile(JavaCast("string", "^(?:[a-z]+://)?[^/]+(/.*)?$"), javaCast("int", 2)); | |
| matcher = pattern.Matcher(JavaCast("string", baseUri)); | |
| if (matcher.find() && matcher.groupCount() > 0) { | |
| group = matcher.group(javaCast("int", 0)); | |
| if (!isNull(group)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| jsonData = [ | |
| { | |
| "city":"Adrian", | |
| "state":"MI", | |
| "school":"Adrian College" | |
| }, | |
| { | |
| "city":"Albion", | |
| "state":"MI", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfoutput> | |
| <cfset reqid = randRange(100000,200000000)> | |
| #reqid# | |
| </cfoutput> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfoutput> | |
| <cfset reqid = randRange(100000000000000000000000,200000000000000000000000)> | |
| #reqid# | |
| </cfoutput> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfoutput> | |
| <cfset reqid = "#randRange(100000000000000000000000,200000000000000000000000)#"> | |
| </cfoutput> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| // CFScript version | |
| writeOutput( | |
| 'Hello world from CFScript! ' & | |
| 'The server time is ' & now() | |
| ); | |
| </cfscript> | |
| <hr/> | |
| <cfoutput> | |
| <!--- CFML version ---> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| for (i = 1; i<= 12; i++) { | |
| writeOutput("#i# #Int(i/4)# | ") | |
| } | |
| // CFScript version | |
| </cfscript> | |
| <hr/> | |
| <cfoutput> | |
| <!--- CFML version ---> | |
| Hello again, it's now: #now()#! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| for (i = 1; i<= 12; i++) { | |
| writeOutput("#i# #Int(i/4) -#") | |
| } | |
| // CFScript version | |
| </cfscript> | |
| <hr/> | |
| <cfoutput> | |
| <!--- CFML version ---> | |
| Hello again, it's now: #now()#! |