乱码问题,怎么处理呢?

杨松坤 发布于 2012/07/11 18:07
阅读 73
收藏 0
注册成功! 姓名:?; 年龄:; 性别:; 乱码问题,怎么处理呢?
加载中
0
杨松坤
杨松坤
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
 "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
 " http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<constant name="struts.i18n.encoding" value="UTF-8"></constant>
<package name="ysk" namespace="/" extends="struts-default">
<action name="regist" class="ysk.regist.RegistAction">
<result name="success">/success.jsp</result>
</action>
</package>
</struts>
0
杨松坤
杨松坤

<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%
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>regist成功!</title>
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="expires" content="0">   
 <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
 <meta http-equiv="description" content="This is my page">
 <!--
 <link rel="stylesheet" type="text/css" href="styles.css">
 -->
  </head>

  
  <body>
   注册成功!
    姓名:${applicationScope.name};
   年龄:${applicationScope.age};
   性别:${application.sex};
    
 </body>
</html>

0
杨松坤
杨松坤
处理了,我把各个面页,都统一成utf-8,就行了。
返回顶部
顶部