"Spring Boot" Spring boot uses @restcontroller does not work, does not return JSON, still to find the interface of the request address corresponding page

Source: Internet
Author: User

Problem Description:

The use of @restcontroller in spring boot does not work, does not return JSON, still look for the interface of the request address corresponding page

Performance results:

1 "Using the Postman Test interface, the performance of the return is 404, the corresponding page address is not found." 2 "docking front desk, access directly return system exception!!

Workaround:

The final reason is that the controller layer is inherited from the interface layer. Like a service, there is a service interface layer that has a SERVICEIMPL implementation layer. Controller is the same structure, one is the interface layer, and the other is the implementation layer. Before, such interface access interface, return the results are no problem, now access to this problem. So cancel the interface layer and write the @restcontroller@requestmapping ("/ten/goodstype") public class tengoodstypeapiimpl{} directly above the implementation layer, Interface above directly specify the request address and method can be @requestmapping (value = "Insert", method = requestmethod.post) public    ajaxresult<  goodstype>  Insert (@RequestBody goodstype entity) {}

The cause of this problem has not yet been identified, if there is a similar situation, hope to inform!!! Thank you!!!

"Spring Boot" Spring boot uses @restcontroller does not work, does not return JSON, still to find the interface of the request address corresponding page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.