Velocity乱码问题解决
其它都不重要,重要的response要设置字符集。//...response.setContentType("text/html; charset=UTF-8");Template t = engine.getTemplate("molamola.html", "UTF-8");VelocityContext context = new VelocityContext();context.put("selectedTable", selectedTable);context.put("tables", tables);context.put("columns", columns);try {t.merge(context, response.getWriter());} catch (IOException e) {logger.warning("IO error: " + e.getMessage());}//...
页:
[1]