提交 e826dc1a 编写于 作者: J Jesse Glick

Normalizing form binding.

上级 0e8d363c
......@@ -175,20 +175,15 @@ public class Shell extends CommandInterpreter {
}
@Override
public Builder newInstance(StaplerRequest req, JSONObject data) {
return new Shell(data.getString("command"));
}
@Override
public boolean configure(StaplerRequest req, JSONObject data) {
setShell(req.getParameter("shell"));
return true;
public boolean configure(StaplerRequest req, JSONObject data) throws FormException {
req.bindJSON(this, data);
return super.configure(req, data);
}
/**
* Check the existence of sh in the given location.
*/
public FormValidation doCheck(@QueryParameter String value) {
public FormValidation doCheckShell(@QueryParameter String value) {
// Executable requires admin permission
return FormValidation.validateExecutable(value);
}
......
......@@ -25,7 +25,7 @@ package hudson.tasks.Shell;
f=namespace(lib.FormTagLib)
f.section(title:_("Shell")) {
f.entry(title:_("Shell executable"),help:"/help/shell/shellexe.html") {
f.textbox(name:"shell",value:descriptor.shell,checkUrl:"'${rootURL}/builder/Shell/check?value='+encodeURIComponent(this.value)")
f.entry(field: 'shell', title:_("Shell executable")) {
f.textbox()
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册