天道酬勤,学无止境

coldfusion

Running Lucee on Tomcat and need to server a JSP page

I have a Lucee box that is running with Tomcat. Everything is great with the site and CFM pages. I was recently given a page in JSP that the client would like to run on the site. Everything I had read says no problem so I agreed to run it. Put the file in a directory and instead of "processing" it ran like and html page would and I could see the code. Realized that Tomcat hadn't been instructed to process JSP files so I added <url-pattern>*.jsp</url-pattern> to: <servlet-mapping> <servlet-name>CFMLServlet</servlet-name> <url-pattern>*.cfm</url-pattern> <url-pattern>*.cfml</url-pattern> <url

2021-09-24 16:18:10    分类:问答    jsp   tomcat   coldfusion   railo   lucee

以在 sql 查询中调用列的方式返回查询行(returning the query row with the way the columns are called in sql query)

问题 我有一个查询,我按照我想要的方式调用列,我不能使用查询的 ColumnList 因为它按字母顺序对列进行排序,另一件事我需要在结构中获取查询的特定行及其关联的列: 所以这是我的功能,我试图以我想要的方式引入列: <cffunction name="rowToStruct" access="public" returntype="struct" output="false"> <cfargument name="queryObj" type="query" required="true" /> <cfargument name="row" type="numeric" required="true" /> <cfset var returnStruct = structNew()> <cfset var colname = ""> <cfset arguments.queryObj = arrayToList(arguments.queryObj.getMeta().getColumnLabels())> <cfloop list="#arguments.queryObj#" index="colname"> <cfset "returnStruct.#colname#" = arguments.queryObj[colname][arguments.row]> <

2021-09-24 07:38:05    分类:技术分享    coldfusion

以在 sql 查询中调用列的方式返回查询行(returning the query row with the way the columns are called in sql query)

问题 我有一个查询,我按照我想要的方式调用列,我不能使用查询的 ColumnList 因为它按字母顺序对列进行排序,另一件事我需要在结构中获取查询的特定行及其关联的列: 所以这是我的功能,我试图以我想要的方式引入列: <cffunction name="rowToStruct" access="public" returntype="struct" output="false"> <cfargument name="queryObj" type="query" required="true" /> <cfargument name="row" type="numeric" required="true" /> <cfset var returnStruct = structNew()> <cfset var colname = ""> <cfset arguments.queryObj = arrayToList(arguments.queryObj.getMeta().getColumnLabels())> <cfloop list="#arguments.queryObj#" index="colname"> <cfset "returnStruct.#colname#" = arguments.queryObj[colname][arguments.row]> <

2021-09-24 07:36:32    分类:技术分享    coldfusion

Images from outside wwwroot not displaying (despite mapping)

In my ColdFusion application, I want to keep the images outside of wwwroot in this folder: C:\extSite\stdImages I created a mapping in wwwroot\WEB-INF\jrun-web.xml like this: <virtual-mapping> <resource-path>/extStdImages</resource-path> <system-path>C:\extSite\stdImages\</system-path> </virtual-mapping> To display an image, I do this: <img src="/extStdImages/abc.jpg"> This works fine on my dev site (which is using ColdFusion's built-in web server), but the image does not display in production (where I am using IIS). I am wondering if I have to tweak something in IIS or elsewhere on the

2021-09-24 07:27:33    分类:问答    iis   coldfusion

如何使用 jQuery.post() 将 JSON 数据返回到 Coldfusion 8 cfc?(How do I return JSON data using jQuery.post() to a Coldfusion 8 cfc?)

问题 如何使用 jQuery.post() 将表单发布到 Coldfusion.cfc 方法并返回 json 数据? 是否有某种方法需要格式化 url 或表单值,以便指定远程调用的 cfc 方法? 我如何告诉 Coldfusion 返回 json 数据? 我搜索了现有的 jQuery/Coldfusion.cfc 问题,我正在寻找一些清晰度。 我找不到显示与 Coldfusion cfc 之间的完整过程的示例。 HTML 表单: <!--- Assume: jquery, jquery-ui, sample.js is loaded ---> <p><a href="#" id="openDialog">Open Dialog</a></p> <div id="myDialog" title="My Dialog" class="dialog"> <form id="myForm"> <label for="title">Title:</label><br /> <input type="text" name="title" id="title" value="" /><br /> <label for="address">Address:</label><br /> <input type="text" name="address" id="address" value="" /

2021-09-24 05:57:09    分类:技术分享    jquery   ajax   jquery-ui   coldfusion   cfc

访问某个页面时如何删除客户端cookie?(How to delete a client-side cookie when I access a certain page?)

问题 我试图在访问某个页面时删除客户端 cookie。 我该怎么做? 即使在使用下面的代码后,我也无法删除客户端 cookie: <cfcookie name="GIFT CAT" value="" expires="NOW" /> <cfset StructDelete(cookie, 'GIFTCAT', false)> 回答1 您需要确保所有属性都与设置的 cookie 上的相同。 如此安全,特别是域和路径。 <cfcookie name="test1" value="1" domain="test.com" /> <cfcookie name="test1" value="" expires="now" /> 不起作用,但是 <cfcookie name="test1" value="1" domain="test.com" /> <cfcookie name="test1" value="" domain="test.com" expires="now" /> 确实有效。 回答2 (从评论中扩展) 听起来您正在错误地测试 cookie 状态。 您不能在单个 http 请求中执行此操作。 必须将 http 响应发送回浏览器才能真正删除客户端 cookie。 该更改将反映在下一个http 请求中。 当我保留转储以查看显示空字符串的结果时 此外,如果您查看 ColdFusion

2021-09-24 05:27:28    分类:技术分享    cookies   coldfusion

来自 cfdocument 中的二进制文件的 cfimage(cfimage from binary in cfdocument)

问题 我正在动态编写 PDF,并在文档上创建 QR 码以用于电子票务 我将我的 cfdocument localurl=yes 设置为包含一个不同的图像,这工作正常,但由于我使用 API 调用来获取 qrCode 的二进制文件,使用 cfimage 显示图像,它只显示一个红色的 X <cfdocument format="PDF" overwrite="Yes" localUrl="yes" pageType = "letter"> <body> <cfoutput> <section id="header"> <img src="file:///#ExpandPath('images/header.png')#"/> <cfimage action="writeToBrowser" source="#rc.qrCode#" /> </cfoutput> </body> </html> </cfdocument> 源变量 rc.qrCode 是一个二进制响应,在我放入 cfdocument 之前它可以完美运行,它会生成一个像这样的 url http://mysite/CFFileServlet/_cf_image/_cfimg-7945382145198648283.PNG作为图像源 我确信这与 localurl 和 file:/// 有关,我只是知识不足,不知道为什么 回答1

2021-09-24 05:02:23    分类:技术分享    coldfusion   cfdocument   cfimage

returning the query row with the way the columns are called in sql query

I have a query where I am calling the columns like the way i want, I cannot use ColumnList of query because it sorts the column alphabatically, another thing i need to get the specific row of the query and its associated columns in a structure: So here is my function which i am trying to bring the columns in the manner i want: <cffunction name="rowToStruct" access="public" returntype="struct" output="false"> <cfargument name="queryObj" type="query" required="true" /> <cfargument name="row" type="numeric" required="true" /> <cfset var returnStruct = structNew()> <cfset var colname = ""> <cfset

2021-09-24 01:54:05    分类:问答    coldfusion

How do I return JSON data using jQuery.post() to a Coldfusion 8 cfc?

How do I post a form using jQuery.post() to a Coldfusion.cfc method and return json data? Is there a certain way I need to format the url or form values in order to specify the cfc method to invoke remotely? How do I tell Coldfusion to return json data? I've searched the existing jQuery/Coldfusion.cfc questions and I'm looking for some clarity. I can't find an example that shows the full process to/from a Coldfusion cfc. HTML Form: <!--- Assume: jquery, jquery-ui, sample.js is loaded ---> <p><a href="#" id="openDialog">Open Dialog</a></p> <div id="myDialog" title="My Dialog" class="dialog">

2021-09-24 00:45:22    分类:问答    jquery   ajax   jquery-ui   coldfusion   cfc

How to return both an "id" and "text"

I am using AutoComplete to search by name. I'm able to output the names, but after submitting the form, I would like to pass the emp_id value, not the fullname. How can I modify it to get the emp_id value, not the fullname? I would like it after I submit the form I get the emp_id not the fullname value. search_employee.cfc <cfcomponent> <cffunction name="queryNames" access="remote"> <cfargument name="searchPhrase" /> <cfquery name="query_names" datasource=""> SELECT fullname ,emp_id .... </cfquery> <cfset result = arrayNew(1) /> <cfloop query="query_names"> <cfset ArrayAppend(result, query

2021-09-24 00:07:50    分类:问答    jquery   coldfusion   jquery-ui-autocomplete