英文:
How to get status description from spring boot rest controller
问题
我在Spring Boot中有一个带有内嵌Tomcat的REST控制器。该控制器从ASP .NET应用程序调用,他们会检查StatusDescription是否为“OK”。我的响应数据是正常的,但Status Description始终为空字符串。
是否有任何方法可以获取StatusDescription?
示例API:
@GetMapping(value = "/updateStatus", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<CheckStatusResponse> updateStatusResponse(@RequestParam(value = "TransactionId", required = false) String transactionID,
@RequestParam(value = "VenderId", required = false) String vendorId,
@RequestParam(value = "Status", required = false) String transactionStatus,
@RequestParam(value = "BcCode", required = false) String bcId,
@RequestParam(value = "rrn", required = false) String rrn) {
AepsTransaction transaction = new AepsTransaction();
transaction.setTransactionId(transactionID);
transaction.setTransactionStatus(transactionStatus);
transaction.setRrn(rrn);
transaction.setBcId(bcId);
return new ResponseEntity<>(aepsService.upDateStatusCallBackHandeling(transaction), HttpStatus.OK);
}
英文:
I have a rest controller in springboot with embedded tomcat. the controller is calling from ASP .NET application where they are checking StatusDescription is "OK" or not. My response is ok with data but Status Description is always empty String.
is there any way to get StatusDescription?
example api:
@GetMapping(value = "/updateStatus", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<CheckStatusResponse> updateStatusResponse(@RequestParam(value = "TransactionId", required = false) String transactionID,
@RequestParam(value = "VenderId", required = false) String vendorId,
@RequestParam(value = "Status", required = false) String transactionStatus,
@RequestParam(value = "BcCode", required = false) String bcId,
@RequestParam(value = "rrn", required = false) String rrn) {
AepsTransaction transaction = new AepsTransaction();
transaction.setTransactionId(transactionID);
transaction.setTransactionStatus(transactionStatus);
transaction.setRrn(rrn);
transaction.setBcId(bcId);
return new ResponseEntity<>(aepsService.upDateStatusCallBackHandeling(transaction), HttpStatus.OK);
}
答案1
得分: 0
我找到了答案。这个问题出现在Tomcat版本大于8.5的情况下。如果你将Tomcat降级到8.0,问题就会解决。
英文:
i found the answer. This problem occur for tomcat version greater than 8.5. if you downgrade your tomcat to 8.0, the problem is solved
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论