javax.servlet.ServletException: net.sf.json.JSONException: JSONObject["consulHostUrl"] not found.
@Override public boolean configure(StaplerRequest req, JSONObject formData) throws FormException { LOGGER.warning(formData.toString());
consulHostUrl = formData.getString("consulHostUrl"); //errors here
req.bindJSON(this, formData); save(); return super.configure(req, formData); }
{"consul-kv-builder":{"consulHostUrl":"http://localhost:8500","consulAclToken":"","consulApiUri":"","consulTimeoutConnection":"","consulTimeoutResponse":"","consulTestUri":"","consulTestResponseCode":""}}
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"><f:section title="Global Consul Settings" name="consul-kv-builder"> <f:entry title="Host URL" help="help-hostUrl.html"> <f:textbox field="consulHostUrl" name="consulHostUrl" /> </f:entry> <f:entry title="ACL Token" help="help-token.html"> <f:textbox field="consulAclToken" name="consulAclToken" value="" /> </f:entry> <f:entry title="API URI (/v1/kv/)" help="help-urlOverride.html"> <f:textbox field="consulApiUri" name="consulApiUri" /> </f:entry> <f:entry title="Connection Timeout (10000)" help="help-timeoutConnection.html"> <f:textbox field="consulTimeoutConnection" name="consulTimeoutConnection" /> </f:entry> <f:entry title="Response Timeout (30000)" help="help-timeoutResponse.html"> <f:textbox field="consulTimeoutResponse" name="consulTimeoutResponse" /> </f:entry> <f:entry title="Test URI (/status/leader)" help="help-testUri.html"> <f:textbox field="consulTestUri" name="consulTestUri" /> </f:entry> <f:entry title="Test Response Code (200)" help="help-testResponseCode.html"> <f:textbox field="consulTestResponseCode" name="consulTestResponseCode" /> </f:entry> <f:validateButton title="${%Test Connection}" progress="${%Testing...}" method="testConnection" with="consulHostUrl,consulTestUri,consulTestResponseCode" /> </f:section></j:jelly>
Try getObject("consul-kv-builder").getString
Note I'm on my phone so the get object call could be something else.
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/aa85faaa-fa10-4ac2-9fd3-1d22a4f57cde%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.