我在struts2中使用display-tag
将表导出到excel表中。当我下载工作表时,它下载得很好,但会发出此警告:
com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Error setting expression '6578706f7274' with value '[Ljava.lang.String;@17e4898'
ognl.ExpressionSyntaxException: Malformed OGNL expression: 6578706f7274 [ognl.ParseException: Encountered " <INT_LITERAL> "7274 "" at line 1, column 9.
Was expecting one of:
<EOF>
"," ...
"=" ...
"?" ...
"||" ...
"or" ...
"&&" ...
"and" ...
"|" ...
"bor" ...
"^" ...
"xor" ...
"&" ...
"band" ...
"==" ...
"eq" ...
"!=" ...
"neq" ...
"<" ...
"lt" ...
">" ...
"gt" ...
"<=" ...
"lte" ...
">=" ...
"gte" ...
"in" ...
"not" ...
"<<" ...
"shl" ...
">>" ...
"shr" ...
">>>" ...
"ushr" ...
"+" ...
"-" ...
"*" ...
"/" ...
"%" ...
"instanceof" ...
"." ...
"(" ...
"[" ...
<DYNAMIC_SUBSCRIPT> ...
]
at ognl.Ognl.parseExpression(Ognl.java:112)
at com.opensymphony.xwork2.ognl.OgnlUtil.compile(OgnlUtil.java:241)
at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:213)
at com.opensymphony.xwork2.ognl.OgnlValueStack.trySetValue(OgnlValueStack.java:186)
at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:173)
at com.opensymphony.xwork2.ognl.OgnlValueStack.setParameter(OgnlValueStack.java:151)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:292)
......
......
and so on.....
我在JSP文件中的显示表是:
<display:table class='displayTable' id='orderList' name='orderList' list='orderList' export="true" requestURI="listOrders" cellpadding="0" cellspacing="0" decorator="com.sanyasi.Decorator.OrderListingDataEntryDecorator">
<display:setProperty name="export.excel" value="true"/>
<display:setProperty name="export.excel.filename" value="order_details.xls" />
<display:column title="Action" property="action"></display:column>
<display:column title="Patient Name" property="patientName"></display:column>
<display:column title="Patient Phone" property="patientPhone"></display:column>
<display:column title="Disease" property="disease"></display:column>
<display:column title="Call Agent" property="callAgent"></display:column>
<display:column title="Order Status" property="orderStatus"></display:column>
<display:column title="Delivery Mode" property="deliveryMode"></display:column>
<display:column title="Delivery Status" property="deliveryStatus"></display:column>
<display:column title="Delivered By" property="deliveryBy"></display:column>
<display:column title="Delivery Date" property="deliveryDate"></display:column>
<display:column title="Details" property="detail"></display:column>
</display:table>
当我点击export
时,display-tag会自动生成此URL
http://localhost:8084/myaction.action?d-3682230-e=2&6578706f7274=1
答案 0 :(得分:0)
OGNL仅支持在Java中很好地形成的名称属性,这些名称不能以数字开头。
您无法避免此警告