Home  >  Article  >  Database  >  SSH2中的编码过滤器为什么不起作用?

SSH2中的编码过滤器为什么不起作用?

WBOY
WBOYOriginal
2016-06-07 15:33:131347browse

以下是小弟在web.xml文件中的配置代码: !-- 定义编码过滤方式 -- filter filter-nameencodingFilter/filter-name filter-classorg.springframework.web.filter.CharacterEncodingFilter/filter- class init-param param-nameencoding/param-name param-valu

以下是小弟在web.xml文件中的配置代码:


 
         encodingFilter
         org.springframework.web.filter.CharacterEncodingFilter

class>
        
                 encoding
                 utf-8
        

        
                 forceEncoding
                 true
        

 
 
          encodingFilter
          /*
 

小弟要实现的是一个注册功能,用的是form表单的POST方式进行提交,具体操作是点击注册后,用JS

的submit()进行提交,

不知道为什么会出现乱码,小弟用的框架是SSH2,

采用下面这段代码可以解决乱码问题,

temp = new String(name.getBytes("ISO-8859-1"),"utf-8");

小弟奇怪为什么SSH2框架的过滤器不起作用,求高人指点啊~~~~~~~~~~~~~~~

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn