Ticket #50 (closed Bug: fixed)

Opened 15 years ago

Last modified 14 years ago

报价页推荐经销商在某些ie6浏览器中出现乱码的问题

Reported by: chenchongqi Owned by: huangxianduan
Priority: minor Milestone:
Component: 报价库 Version: 报价库4.0
Keywords: 乱码 Cc: yuanhuoqing@…
Due Date:

Description

并非所有ie6都出现,firefox没有问题,具体重现步骤如下:

1.清空浏览器缓存
2.访问一个索引页面,此时正常,用户httpwatch看到price.do接口是gbk编码
3.f5刷新当前页面,此时price.do接口没有重新请求,而是用了浏览器缓存,但是没有gbk编码的设定,内容为乱码

测试环境把price.do接口换为一个普通jsp后,这个问题没有重现
把$.get()换为$.ajax()并加上scriptCharset参数,貌似没有什么作用

Change History

comment:1 Changed 15 years ago by chenchongqi

  • Cc yuanhuoqing@… added; yuanhuoqing@… removed

comment:2 Changed 14 years ago by yuanhuoqing

参照在产品终端页的接口是jsp页面不会出现乱码,所以改成jsp中include的方法解决此问题。
目前接口的链接地址: http://product.pconline.com.cn/pdlib/service2011/price_dealer.jsp
price_dealer.jsp页面内容如下:

     <%
	int expires = Integer.parseInt(StringUtils.defaultString(request.getParameter("time"),"7200"));
	response.setHeader("Pragma","");
	response.setDateHeader("Expires", System.currentTimeMillis() + (expires * 1000));
	response.setHeader("Cache-Control","max-age="+expires);
	
	
	int areaId    		  = Integer.parseInt(StringUtils.defaultString(request.getParameter("areaId"), "-1"));
	int groupType   	  = Integer.parseInt(StringUtils.defaultString(request.getParameter("groupType"), "3"));
	int smallTypeId		  = Integer.parseInt(StringUtils.defaultString(request.getParameter("smallTypeId"), "-1"));
	int brandId    		  = Integer.parseInt(StringUtils.defaultString(request.getParameter("brandId"), "-1"));
	int cnt        		  = Integer.parseInt(StringUtils.defaultString(request.getParameter("cnt"), "4"));
	String areaIds    	 = StringUtils.defaultString(request.getParameter("areaIds"), "100");
	String  url           = null;
	if(groupType == 3){
		url = "/price.do?method=getCompanyJson&areaId=" + areaId +"&brandId=" + brandId +"&qq&priority&areaIds="+areaIds;
	}else {
		url = "/price.do?method=getCompany2Json&areaId=" + areaId +"&smalltypeId=" + smallTypeId +"&qq&priority&areaIds="+areaIds;
	}
	//System.out.println(url);
%>


<jsp:include page="<%=url%>"></jsp:include>
Last edited 14 years ago by chenchongqi (previous) (diff)

comment:3 Changed 14 years ago by chenchongqi

  • Keywords 乱码 added
  • Component changed from 产品库 to 报价库
  • Version set to 4.0
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.