From 499f7501c8ad3434fb5caba341fe2035eda3a0d0 Mon Sep 17 00:00:00 2001 From: joriewong Date: Tue, 8 Aug 2017 15:22:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9linux=E5=9B=BE=E5=BD=A2?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 兼容linux图形处理 --- .../web/system/servlet/RandCodeImageServlet.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jeecgframework/web/system/servlet/RandCodeImageServlet.java b/src/main/java/org/jeecgframework/web/system/servlet/RandCodeImageServlet.java index 5142efde..1ed93e10 100644 --- a/src/main/java/org/jeecgframework/web/system/servlet/RandCodeImageServlet.java +++ b/src/main/java/org/jeecgframework/web/system/servlet/RandCodeImageServlet.java @@ -47,6 +47,11 @@ public class RandCodeImageServlet extends HttpServlet { * 干扰线的长度=1.414*lineWidth */ private static final int lineWidth = 2; + + public RandCodeImageServlet() { + // 兼容linux图形处理 + System.setProperty("java.awt.headless", "true"); + } @Override public void doGet(final HttpServletRequest request, @@ -234,4 +239,4 @@ public String getCharStr() { return charStr; } -} \ No newline at end of file +}