How to get XPages and JSON to not put variable names in Uppercase

此生再无相见时 提交于 2020-01-06 03:26:06

问题


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)};

I get the error:

Error while executing JavaScript action expression
Script interpreter error, line=6, col=1: Error while executing function '@JdbcUpdate'
Invalid column name 'PRODUCT'.

The problem is that XPages when it converts the JSON it puts product to PRODUCT.

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?

Thanks


回答1:


The problem is com.ibm.xsp.extlib.util.JdbcUtil.appendColumnName()

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.



来源:https://stackoverflow.com/questions/16716141/how-to-get-xpages-and-json-to-not-put-variable-names-in-uppercase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!