CodePudding user response:
Match filter,,import javax.mail. Servlet. *;
The import javax.mail. Servlet. The annotation. WebFilter;
import java.io.IOException;
@ WebFilter (filterName="encodingFilter", urlPatterns={} "*")
Public class encodingFilter implements Filter {
Public void destroy () {
}
Public void doFilter (ServletRequest the req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
The req. SetCharacterEncoding (" utf-8 ");
Resp. SetCharacterEncoding (" utf-8 ");
Chain. DoFilter (the req, resp);
}
Public void init (FilterConfig config) throws ServletException {
}
}
CodePudding user response:
In the server without this two sentences can add try:The response. SetContentType (" text/HTML; Charest=utf-8 ");
The response. SetCharacterEncoding (" utf-8 ");
If not try the above request also
CodePudding user response:
In the server without this two sentences can add try:The response. SetContentType (" text/HTML; Charest=utf-8 ");
The response. SetCharacterEncoding (" utf-8 ");