fixed character encoding bug
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>org.example</groupId>
|
<groupId>org.example</groupId>
|
||||||
<artifactId>Widerhall</artifactId>
|
<artifactId>Widerhall</artifactId>
|
||||||
<version>0.0.20</version>
|
<version>0.0.21</version>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import javax.servlet.http.HttpServlet;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -40,6 +41,7 @@ public abstract class TemplateServlet extends HttpServlet {
|
|||||||
var template = templates.getInstanceOf(path);
|
var template = templates.getInstanceOf(path);
|
||||||
if (template != null){
|
if (template != null){
|
||||||
try {
|
try {
|
||||||
|
resp.setCharacterEncoding("UTF-8");
|
||||||
template.add("data",data);
|
template.add("data",data);
|
||||||
resp.getWriter().println(template.render());
|
resp.getWriter().println(template.render());
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -288,7 +288,6 @@ public class Web extends TemplateServlet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!error){
|
if (!error){
|
||||||
var dummy = req.getParameterMap();
|
|
||||||
try {
|
try {
|
||||||
list.forwardFrom(Util.getCheckbox(req, "forward_from"));
|
list.forwardFrom(Util.getCheckbox(req, "forward_from"));
|
||||||
list.forwardAttached(Util.getCheckbox(req, "forward_attached"));
|
list.forwardAttached(Util.getCheckbox(req, "forward_attached"));
|
||||||
@@ -297,7 +296,6 @@ public class Web extends TemplateServlet {
|
|||||||
LOG.warn("Failed to update MailingList:",e);
|
LOG.warn("Failed to update MailingList:",e);
|
||||||
data.put(ERROR,t("Failed to update MailingList!"));
|
data.put(ERROR,t("Failed to update MailingList!"));
|
||||||
}
|
}
|
||||||
LOG.debug("params: {}",dummy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return loadTemplate(INSPECT,data,resp);
|
return loadTemplate(INSPECT,data,resp);
|
||||||
|
|||||||
Reference in New Issue
Block a user