PA_Login_Portlet_App.ear的LoginView.jsp乱码

LoginView.jsp文件的头部一定要加上编码

<%@ page language="java" contentType="text/html" pageEncoding="UTF-8" session="false"%>

 

 

<%@ include file="./StatusMessageInclude.jspf"%>
   

   <script type="text/javascript">

     function toUnicode(str)
     {
      var unicodeStr = escape(str);
      unicodeStr = unicodeStr.replace(/%/g, "\\");
      //cannot do like this, must reassign new value
      //unicodeStr.replace(/%/g, "\\");

      return unicodeStr;
     }
     function unUnicode(unicodeStr)
     {
      var str = unicodeStr.replace(/\\/g, "%");
      str = unescape(str);

      return str;
     }


     var isSuccess = <%=isLoginSuccessful %>;
     var msg = "<%=message %>";

     if ((!isSuccess) && ("null" != msg))
     {
      //does work
      msg = encodeURI("很抱歉,你的用户名或者密码错误!");
      msg = decodeURI(msg);
                 
      //does work too!
      msg = escape("很抱歉,你的用户名或者密码错误!");
      msg = unescape(msg);
                 
      //does work!
      /*msg = unescape("\u5F88\u62B1\u6B49\uFF0C\u4F60\u7684\u7528\u6237\u540D\u6216\u8005\u5BC6\u7801\u8F93\u5165\u9519\u8BEF\uFF01");*/

                    //does work!
       /*msg = toUnicode("很抱歉,你的用户名或者密码错误!");
       msg = unUnicode(msg);*/

      //alert(msg);   
     }

    //-->
   </script>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值