ITeye博客

tomcat下开发extjs转到weblogic乱码问题

fourfire · 2009-05-08 18:01 · extjs · Markdown

最近把extjs项目发布到weblogic下,出现了问题,乱码 进行调整后解决。 1 主页用了<c:import>5个,结果weblogic下出不来,并且报以下异常 java.lang.IllegalStateException: Cannot forward a response that is already committed 修改为ajax获得更新div,解决 2 Ext.ajax.request() url:a.do?a=张三 用get方法传递,乱码 上传文件upload=true乱码 解决办法: tomcat下conf->server.xml connector下增加 URIEncoding="UTF-8" 所有js,jsp文件编码改为UTF-8 用encodeURI函数处理get的url串 如:encodeURI('storage/ajaxSaveInBill.do?'+ params) 解决

评论(2)

  1. #2 楼 · fourfire · 2009-05-21 10:27

    不用c:import而用ajax 例如:

    
    var market_reader=new Ext.data.JsonReader( {
    		root :'root'
    	}, [ {
    		name :'id',
    		mapping :'id',
    		type :'string'
    	}, {
    		name :'title',
    		mapping :'title',
    		type :'string'
    	}, {
    		name :'imagepath',
    		mapping :'imagepath',
    		type :'string'
    	}
    	 ]);
    		var market_ds = new Ext.data.Store( {
    		reader :market_reader,
    		proxy :new Ext.data.HttpProxy( {
    			url :'marketList.do'
    
    		})
    	});
    	market_ds.load();
    	var market_tpl = new Ext.XTemplate(
    			'<ul width="370"> <tpl for=".">' +
    			'<li width="360">' +
    			'<tpl if="xindex==1 && imagePath!=null">' +
    			'<img   width="100" height="80" src="viewPhoto.do?path={imagePath}"/>' +
    			'</tpl>'+
    			'<a href="#" onclick="window.open(\'home/ajaxGetMarketById.do?id={id}&command=view\',\'market\',\'resizable=yes,scrollbars=yes,status=yes,menubar=no,toolbar=no,location=no,directories=no,left=0,top=0,width=1024,height=768\');return false;">{title}</a>' +
    			'</li>' +
    			'</tpl>',
      			'</ul>');
    
    	var market_page = new Ext.Panel( {
    		applyTo:'marketDiv',
    			
    			border:false,
    		items :new Ext.DataView( {
    			store :market_ds,
    			tpl :market_tpl,
    			
    			overClass :'x-view-over',
    			itemSelector :'div.thumb-wrap',
    			emptyText :'No images to display'
    			
    		})
    	});
    
    
  2. #1 楼 · kaishiba · 2009-05-18 11:48

    请问:修改为ajax获得更新div 啥意思?

评论功能维护中,当前仅展示历史评论。