jsp亂碼處理

在數據顯示頁面下 

<% request.setCharacterEncoding("GB2312");
  response.setContentType("text/html;charset=gbk"); %>

 

 

 

 

<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>

<%@page import="mypage.MyPerson;"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
   
    <title>My JSP 'requestForm3.jsp' starting page</title>
  <% request.setCharacterEncoding("GB2312");
  response.setContentType("text/html;charset=gbk"); %>

發佈了30 篇原創文章 · 獲贊 2 · 訪問量 12萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章