forked from agwlvssainokuni/springapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
invoker.html
158 lines (154 loc) · 5.63 KB
/
invoker.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>汎用起動機能</title>
<link rel="stylesheet" media="screen" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<link rel="stylesheet" media="screen" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(function() {
$("#invokeBtn").click(function(event) {
$.ajax($("#invokerUri").val(), {
method : "POST",
data : {
beanName : $("#beanName").val(),
className : $("#className").val(),
methodName : $("#methodName").val(),
methodIndex : $("#methodIndex").val(),
args : $("#args").val(),
argTypes : $("#argTypes").val()
},
success : function(data, textStatus, jqXHR) {
$("#result").val(data);
},
error : function(jqXHR, textStatus, errorThrown) {
alert(errorThrown);
}
});
});
$("#className").blur(function(event) {
var old = $(this).data("old");
if (old == $(this).val()) {
return;
}
$(this).data("old", $(this).val());
$.ajax($("#invokerUri").val() + "?bean", {
method : "POST",
data : {
className : $("#className").val()
},
success : function(data, textStatus, jqXHR) {
$("#beanName option.withValue").remove();
for (var i = 0; i < data.length; i++) {
var opt = $("<option/>").addClass("withValue");
opt.attr("value", data[i]).attr("label", data[i])
$("#beanName").append(opt);
}
$("#beanName option.withValue:first").attr("selected", "selected");
},
error : function(jqXHR, textStatus, errorThrown) {
alert(errorThrown);
}
});
});
$("#methodName").blur(function(event) {
var old = $(this).data("old");
if (old == $(this).val()) {
return;
}
$(this).data("old", $(this).val());
$.ajax($("#invokerUri").val() + "?method", {
method : "POST",
data : {
className : $("#className").val(),
methodName : $("#methodName").val()
},
success : function(data, textStatus, jqXHR) {
$("#methodIndex option.withValue").remove();
for (var i = 0; i < data.length; i++) {
var opt = $("<option/>").addClass("withValue");
opt.attr("value", i).attr("label", "(" + data[i] + ")")
$("#methodIndex").append(opt);
}
$("#methodIndex option.withValue:first").attr("selected", "selected");
},
error : function(jqXHR, textStatus, errorThrown) {
alert(errorThrown);
}
});
});
});
</script>
</head>
<body role="document">
<div class="navbar navbar-default" role="navigation">
<div class="container">
<div class="nav navbar-header">
<div class="navbar-brand">汎用実行機能</div>
</div>
</div>
</div>
<div class="container" role="main">
<h2 class="page-header">汎用実行機能</h2>
<div role="form" class="form-horizontal">
<div class="form-group">
<label for="invokerUri" class="col-sm-1 control-label">実行URI</label>
<div class="col-sm-11">
<input type="text" id="invokerUri" name="invokerUri" class="form-control" placeholder="汎用実行機能のURIを指定してください" />
</div>
</div>
<div class="form-group">
<label for="className" class="col-sm-1 control-label">クラス</label>
<div class="col-sm-7">
<input type="text" id="className" name="className" class="form-control" placeholder="呼び出すBeanのFQCNを指定してください" />
</div>
<div class="col-sm-4">
<select id="beanName" name="beanName" class="form-control">
<option value="0" label="Bean名称(非必須)" />
</select>
</div>
</div>
<div class="form-group">
<label for="methodName" class="col-sm-1 control-label">メソッド</label>
<div class="col-sm-7">
<input type="text" id="methodName" name="methodName" class="form-control" placeholder="呼び出すメソッドの名称を指定してください" />
</div>
<div class="col-sm-4">
<select id="methodIndex" name="methodIndex" class="form-control">
<option value="0" label="呼出すメソッドを引数のパターンで指定" />
</select>
</div>
</div>
<div class="form-group">
<label for="args1" class="col-sm-1 control-label">引数</label>
<div class="col-sm-7">
<textarea rows="3" cols="1" id="args" name="args" class="form-control" placeholder="引数リストをJSON形式で指定"></textarea>
</div>
<div class="col-sm-4">
<textarea rows="3" cols="1" id="argTypes" name="argTypes" class="form-control" placeholder="引数の型のリストをJSON形式で指定(非必須)"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-sm-11 col-sm-offset-1">
<button class="btn btn-default btn-block" type="button" id="invokeBtn">実行</button>
</div>
</div>
</div>
<div class="form-horizontal" role="form">
<div class="form-group">
<label for="result" class="col-sm-1 control-label">実行結果</label>
<div class="col-sm-11">
<textarea rows="5" cols="1" id="result" name="result" class="form-control"></textarea>
</div>
</div>
</div>
</div>
<div class="container" role="main">
<address class="text-center">Copyright ©, 2015, agwlvssainokuni</address>
</div>
</body>
</html>