如何获取XPages和JSON不将变量名大写 [英] How to get XPages and JSON to not put variable names in Uppercase
问题描述
我正在尝试使用XPages Extension Library进行以下更新.
I'm trying to do the following update using XPages Extension Library.
#{javascript:var mydata = {
product: getComponent("inputProduct").getValue()
};
var params = [1, 2];,
@JdbcUpdate("mssql","table_name",mydata,"order_no=? AND order_line_no=?",params)};
我得到了错误:
Error while executing JavaScript action expression
Script interpreter error, line=6, col=1: Error while executing function '@JdbcUpdate'
Invalid column name 'PRODUCT'.
问题是XPages转换将product
放入PRODUCT
的JSON时.
The problem is that XPages when it converts the JSON it puts product
to PRODUCT
.
可以将扩展库设置为尊重JSON的大小写,而不转换为大写吗?还是有人可以指出如果没有扩展库,可以在何处设置此设置?
Can you set the extension library to respect the case of the JSON and not convert to Uppercase? Or can anyone point to where this setting could be set if not the extension library?
谢谢
推荐答案
问题是com.ibm.xsp.extlib.util.JdbcUtil.appendColumnName()
The problem is com.ibm.xsp.extlib.util.JdbcUtil.appendColumnName()
public static void appendColumnName(StringBuilder b, String colName) {
colName = colName.toUpperCase();
b.append(colName);
}
public static void appendColumnName(StringBuilder b, String colName) {
colName = colName.toUpperCase();
b.append(colName);
}
这只是需要将变量更改为大写形式.
This just needs changing to not upper case the variable.
如果其他变量变为大写,可能还有其他方法需要更改.
There may be other methods that need changing if other variables are getting upper cased.
这篇关于如何获取XPages和JSON不将变量名大写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!