componentDidMount() {
$.ajax({
type: 'POST',
url: 'http://localhost:8080/UIServices/rest/dataService/postDataConnection?userName=SIVASO',
data: {
dataConnectionName: this.state.dataConnectionName,
dataConnectionType: this.state.dataConnectionType,
databaseHost: this.state.databaseHost,
dataConnectionSid: this.state.dataConnectionSid,
dataConnectionUsername: this.state.dataConnectionUsername,
dataConnectionPassword: this.state.dataConnectionPassword,
description: this.state.description,
connectionMethod: this.state.connectionMethod,
databasePort: this.state.databasePort,
jdbcDriver: this.state.jdbcDriver
}
})
.done(function(data) {
self.clearForm()
})
.fail(function(jqXhr) {
console.log('failed to save');
});
}
handleSubmit(e){
var self
e.preventDefault();
self = this
console.log(this.state);
var data = {
dataConnectionName: this.state.dataConnectionName,
dataConnectionType: this.state.dataConnectionType,
databaseHost: this.state.databaseHost,
dataConnectionSid: this.state.dataConnectionSid,
dataConnectionUsername: this.state.dataConnectionUsername,
dataConnectionPassword: this.state.dataConnectionPassword,
description: this.state.description,
connectionMethod: this.state.connectionMethod,
databasePort: this.state.databasePort,
jdbcDriver: this.state.jdbcDriver
}
}
clearForm() {
this.setState({
dataConnectionName: "",
dataConnectionType: "",
databaseHost: "",
dataConnectionSid: "",
dataConnectionUsername: "",
dataConnectionPassword: "",
description: "",
connectionMethod: "",
databasePort: "",
jdbcDriver: ""
});
}
我无法在使用帖子休息服务连接后将数据发布到用户界面,任何人都可以帮助我,我在最近2天无法找到任何解决方案。提前谢谢。
保存数据后,我将详细填写所有连接,应将其存储在卡片格式的所有字段的其他组件中。
发布后我能够在检查中获得响应但不在get url中发布数据