extjs5 store load默认Get 导致的问题

小编:管理员 439阅读 2022.09.07

最近的一个项目 本地测试好好的 但是交付以后 出现了 中文条件查询结果返回为空的问题

分析原因发现extjs load 数据 默认是GET方式

而本地却可以

因此推测 :

如果tomcat不支持中文编码 会导致传到后台的中文应该是乱码因此查询不到数据

所以

1 修改tomcat uri编码为UTF-8

 
复制

2 最好 加载方式改为post

proxy:{
		type:"ajax",
		url:$.baseUrl()+"/user/getUsers",
		 actionMethods: {
	            create : 'POST',
	            read   : 'POST', // by default GET
	            update : 'POST',
	            destroy: 'POST'
	        },
		reader:{
			type:"json",
			method: "POST",
			rootProperty :"rows",
			totalProperty :'total'		
		},
		writer:{
			type:"json",
			method: "POST"
		}
	},
复制
关联标签: