coldfusion-2016

How do I load jsoup Java library from inside Coldfusion 2016?

徘徊边缘 提交于 2019-12-11 00:09:58
问题 TLDR: CreateObject function throws an exception (java.lang.ClassNotFoundException) because it cannot see the java class/JAR file. Any ideas what am I doing wrong? Thanks contents of Application.cfc <cfcomponent output="true"> <cfset path = "#Mid(CGI.CF_TEMPLATE_PATH, 1, FindNoCase("index.cfm", CGI.CF_TEMPLATE_PATH)-2)#/java/lib" /> <cfoutput>path: #path#</cfoutput> <cftry> <cfset This.javaSettings = {LoadPaths = ["#path#/", "#path#/java/lib/jsoup-1.12.1.jar", "./java/lib/", "./java/lib/jsoup

Empty CGI.REDIRECT_URL on ColdFusion 2016

喜你入骨 提交于 2019-12-10 21:46:43
问题 I'm in the process of moving a site to ColdFusion 2016 on Linux/Apache, but one issue we have is the CGI.REDIRECT_URL value is empty. I checked and the following was in the /etc/apache2/mod_jk.conf file: JkEnvVar REDIRECT_URL It exists, but it's empty. I couldn't find much on the web to help except this article, but its already setup like that. Vivio thought 2016 had the redirect_url in the request scope, but that's empty as well. 来源: https://stackoverflow.com/questions/48797824/empty-cgi

cfquery crashes when there are tsql comments

落爺英雄遲暮 提交于 2019-12-01 03:57:09
This does not crash in ColdFusion 11, but does crash in ColdFusion 2016 SELECT * FROM dbo.Roles WITH (NOLOCK) WHERE Code IS NOT NULL AND Active = 1 AND RoleID IN (SELECT RoleID FROM dbo.Emp WITH (NOLOCK)) -- It's ok to look at termed employees This works OK in both SELECT * FROM dbo.Roles WITH (NOLOCK) WHERE Code IS NOT NULL AND Active = 1 AND RoleID IN (SELECT RoleID FROM dbo.Emp WITH (NOLOCK)) Is there a setting to restore the orginal behavior? UPDATE I thought I had a minimal example of the issue, but I didn't. Here is the complete query SELECT '<ul>' + STUFF ( ( SELECT MIN(Role) AS "li

ColdFusion too big to be an integer

≯℡__Kan透↙ 提交于 2019-12-01 03:54:49
I am trying to convert a large number going in to Megabytes. I don't want decimals numeric function formatMB(required numeric num) output="false" { return arguments.num \ 1024 \ 1024; } It then throws an error How do I get around this? You can't change the size of a Long, which is what CF uses for integers. So you'll need to BigInteger instead: numeric function formatMB(required numeric num) { var numberAsBigInteger = createObject("java", "java.math.BigInteger").init(javacast("string", num)); var mbAsBytes = 1024 ^ 2; var mbAsBytesAsBigInteger = createObject("java", "java.math.BigInteger")