From d396dbd385e5793465c227a9f4ea07989a5aeb62 Mon Sep 17 00:00:00 2001 From: rinoux Date: Thu, 21 Jun 2018 12:12:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?DEC-2558=20URL=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledata/tabledatapane/FileTableDataPane.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java b/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java index 16d9966a1..a3e6efa5f 100644 --- a/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java +++ b/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java @@ -61,6 +61,8 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URL; import java.util.ArrayList; import java.util.List; @@ -318,7 +320,13 @@ public class FileTableDataPane extends AbstractTableDataPane { } private boolean checkURL(String uri){ - return (uri.matches("https*://.+|\\$\\{.+\\}.*")); + try { + new URL(uri); + return true; + } catch (MalformedURLException e) { + return false; + } + // return (uri.matches("https*://.+|\\$\\{.+\\}.*")); } private JPanel textSetPanel(int width,int height) { From dc09e9eaac77e0e31c5a3d3897ba344c87059222 Mon Sep 17 00:00:00 2001 From: rinoux Date: Thu, 21 Jun 2018 12:52:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?update=20=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/tabledata/tabledatapane/FileTableDataPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java b/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java index a3e6efa5f..93d482139 100644 --- a/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java +++ b/designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java @@ -207,7 +207,7 @@ public class FileTableDataPane extends AbstractTableDataPane { private ActionListener testConnectionListener = new ActionListener() { public void actionPerformed(ActionEvent arg0) { - String uri = urlText.getText(); + String uri = ParameterHelper.analyze4Templatee( urlText.getText(), params); if (!checkURL(uri)) { JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(FileTableDataPane.this), Inter.getLocText("FR-Designer_Add_JS_warning")); return;