设置HTTP header方式

一, Server Code

JSP---->

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%> 

 

Java---->

1 <%
2 response.setHeader("Cache-Control","no-store");   
3 response.setContentType("text/html;charset=UTF-8"); 
4 response.setHeader("Pragma","no-cache");
5 response.setDateHeader ("Expires", 0);     
6 %>

 

二,HTML meta标签

1 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2 
3 <meta charset="utf-8" />

 

三, JS设置requrest Header

 

1 xmlhttp.setRequestHeader("Accept", "*");

 

posted @ 2014-12-25 15:10  daishuguang  阅读(1588)  评论(0编辑  收藏  举报