From c75b6edf518960f7a42a23bd0053fc33f9c4b667 Mon Sep 17 00:00:00 2001 From: fanfuxiaoran <495538672@qq.com> Date: Fri, 17 Jan 2014 14:22:35 +0800 Subject: [PATCH] add validate script name when upload script --- src/main/java/org/bench4q/web/api/ScriptActionController.java | 2 ++ src/main/webapp/script/script.js | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bench4q/web/api/ScriptActionController.java b/src/main/java/org/bench4q/web/api/ScriptActionController.java index 893a2f4b..31d73d7d 100644 --- a/src/main/java/org/bench4q/web/api/ScriptActionController.java +++ b/src/main/java/org/bench4q/web/api/ScriptActionController.java @@ -361,6 +361,8 @@ public class ScriptActionController extends BaseControllerService { if (script.isEmpty()) { return new String("Failed:empty file!"); } + if(scriptName==null||scriptName.equals("")) + return new String("Failed:empty file name!"); String scenarioModel = new String(script.getBytes()); try { diff --git a/src/main/webapp/script/script.js b/src/main/webapp/script/script.js index febac703..530eded8 100644 --- a/src/main/webapp/script/script.js +++ b/src/main/webapp/script/script.js @@ -47,7 +47,6 @@ $('#uploadScript').click(function(){ $('form').ajaxForm({ success: function(responseText){ - $('#scriptInfo').html(status); $("#status").text(responseText); } });