Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改个人信息时发现中文报错 #23

Open
wyue1227 opened this issue Feb 7, 2021 · 2 comments
Open

修改个人信息时发现中文报错 #23

wyue1227 opened this issue Feb 7, 2021 · 2 comments

Comments

@wyue1227
Copy link

wyue1227 commented Feb 7, 2021

修改个人信息时,出现了中文报错。最初的现象是 男 这个字段mysql塞不进去,后来打了个断点发现乱码了=-=
UTF-8的问题,jsp -> Servlet部分出现的,在web.xml里添加了过滤器解决。

<!-- 字符集过滤器 -->
<filter>
      <description>字符集过滤器</description>
      <filter-name>encodingFilter</filter-name>
      <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
      <init-param>
          <param-name>encoding</param-name>
          <param-value>UTF-8</param-value>
      </init-param>
      <init-param>
          <param-name>forceEncoding</param-name>
          <param-value>true</param-value>
      </init-param>
  </filter>
  <filter-mapping>
      <filter-name>encodingFilter</filter-name>
      <url-pattern>/*</url-pattern>
  </filter-mapping>

另,想用这版本代码给对象改一个毕业设计,希望允许。

@4399King
Copy link

4399King commented Jun 1, 2023

确实

@Judy1028
Copy link

Judy1028 commented Jan 1, 2025

太帅了,问了半小时chatgpt都不行,终于弄好了,谢谢大佬!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants