解决发布答卷后,答卷可能出现的乱码问题

This commit is contained in:
keyuan 2021-04-16 08:31:17 +08:00
parent 6c04feef34
commit 00bacedb64

View File

@ -98,6 +98,10 @@ public class DwsAnswerAction extends ActionSupport {
if (directory != null) {
surveyId = directory.getId();
String filterStatus = filterStatus(directory,request);
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
if(filterStatus!=null){
return filterStatus;
}
@ -148,12 +152,13 @@ public class DwsAnswerAction extends ActionSupport {
SurveyDirectory directory = directoryManager.getSurvey(surveyId);
if (directory != null) {
String filterStatus = filterStatus(directory,request);
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
if(filterStatus!=null){
return filterStatus;
}
String htmlPath = directory.getHtmlPath();
htmlPath = htmlPath.substring(0,htmlPath.lastIndexOf("/"));
response.setContentType("text/html;charset=utf-8");
request.getRequestDispatcher("/" + htmlPath+"/m_"+surveyId+".html").forward(request,response);
return NONE;
}