【发布时间】:2014-06-06 18:13:23
【问题描述】:
在 mi web 应用程序中,我有一个组合选项,包括大于或小于符号。当你打开组合看起来不错,但当你选择它看起来不对(图 1)。只有我想在您打开组合和选择时都正确显示。
< 符号是从 Oracle DB 中提取的。我使用了 UTF-8 编码和 ISO-8859-1,但不起作用。
JSP: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
提取值的表
------------------
|ID_VALOR | RTO |
|----------------|
| 1 | < 2h |
| 2 | < 8h |
------------------
查询
@NamedQueries({
@NamedQuery(name = "RangoTemporal.getAll", query = "SELECT tt FROM RangoTemporal tt ORDER BY tt.id ASC")
})
编辑: 添加了创建 de 下拉菜单的代码。 (extJS - Javascript)
// creamos el combo de RTO
var storeRTO = new Ext.data.SimpleStore({
fields: [
{name: 'ID_RTO'},
{name: 'desRTO'}
]
});
var dataRTO = [
[
'',
'<bean:message key="label.gi.procesos.tabs.rtoProceso.automatico"/>'
]
<logic:iterate name="gestionInventariosForm" property="tiposRangoML" id="rto" indexId="index">
<c:if test="${index >= 0}">, </c:if>
[
'<bean:write name="rto" property="id"/>',
'<bean:write name="rto" property="descripcion"/>'
]
</logic:iterate>
];
// create the data store
storeRTO.loadData(dataRTO);
function dameComboRTO(){
var comboRTO = new Ext.form.ComboBox({
store: storeRTO,
fieldLabel:'<bean:message key="label.gi.procesos.tabs.rtoProceso"/>',
displayField:'desRTO',
valueField: 'ID_RTO',
typeAhead: true,
forceSelection: true,
mode: 'local',
triggerAction: 'all',
emptyText:'',
selectOnFocus:true,
editable: true,
id: 'RTO_PROCESO',
<logic:notEqual value="0" name="gestionInventariosForm" property="proceso.id">
value:'<bean:write name="gestionInventariosForm" property="proceso.rtoProceso.id" />',
</logic:notEqual>
<logic:equal value="0" name="gestionInventariosForm" property="proceso.id">
value: '',
</logic:equal>
disabled: false,
hiddenName: 'proceso.rtoProceso.id',
anchor:'80%',
listeners:{
select:{fn:function(combo){
document.getElementById( 'RTO_PROCESO_ID' ).value = combo.getValue();
}}
}
<logic:equal value="0" name="gestionInventariosForm" property="puedeEditar">,readOnly:true,fieldClass: 'NoEditable'</logic:equal>
});
return comboRTO;
}
【问题讨论】:
-
这样显示是因为 JSP 使用了 <或>表示 符号..它只会像这样读取它..您可以毫无问题地继续您的工作..
-
添加创建下拉列表的 JSP 代码 - 您从后端设置值的方式可能存在问题
-
嗨,我添加了创建 de combobox 的代码
标签: oracle jsp extjs utf-8 named-query