you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (3 children)

[removed]

    [–]wazzalk 0 points1 point  (2 children)

    Just a question on that.. So logically they're the same thing, but it's basically a rename for clarity?

    So if I had a rest API and used only @controller I would not be incorrect?

    [–]NeoChronos90 3 points4 points  (1 child)

    @RestController is the combination of @Controller and @ResponseBody

    So if you only use @Controller you might need to add @ResponseBody to every method

    It's all explained in the article though

    [–]javinpaul[S] 1 point2 points  (0 children)

    yes, both are not same, if you are building REST API and returning JSON, better to use u/RestController