acegi中文登陆账号问题

时间:2022-05-06 19:33:00

本人做权限管理系统时遇到的问题,现已解决,tomcat部署在linux系统上,分两步操作具体设置如下:

1修改AuthenticationProcessingFilter类(acegi.jar/org/acegisecurity/ui/webapp)中方法attemptAuthentication添加

try {
      new String(username.getBytes("ISO8859-1"), "GBK");
    } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
    }

对登陆用户名进行转码为gbk。

acegi中文登陆账号问题

2.设置tomcat编码格式为utf-8,server.xml文件中添加URIEncoding="utf-8" 编码格式

acegi中文登陆账号问题