wildwind_zz 发表于 2013-2-3 10:34:32

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]
查看完整版本: Velocity乱码问题解决