Java Spring Boot REST API JSON Response Handling Tutorial with Demonstration

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.ย. 2024

ความคิดเห็น • 61

  • @ThinkConstructive
    @ThinkConstructive  2 ปีที่แล้ว +9

    Java Spring boot REST API project often demands to have responses in a particular format and hence this session will be extremely useful for java spring boot developers who are particularly developing REST APIs. Kindly watch the complete session to get complete benefit from this.
    GitHub link for CloudVendorApi code -
    github.com/thinkconstructive/rest-api-spring-boot-demo/tree/master
    Happy learning.
    Cheers,
    Esha

  • @theshivrajofficial8444
    @theshivrajofficial8444 ปีที่แล้ว +2

    thanks mam for showing the new way to achieve custom response... i have achieved this result by creating lots of DTO classes...but now i got this technic...thanks again for creating awesome content...

    • @ThinkConstructive
      @ThinkConstructive  ปีที่แล้ว +1

      Welcome 😊
      Glad that it helped you. Thanks 😊

  • @pranaypaul6361
    @pranaypaul6361 2 หลายเดือนก่อน +1

    Very simple to the point JSON Response Handling example!

    • @ThinkConstructive
      @ThinkConstructive  19 วันที่ผ่านมา +1

      Glad you liked it!
      Stay connected and please share with others too. Thank you 😊

  • @mithleshpuri
    @mithleshpuri ปีที่แล้ว +5

    Learning lot from your sessions. Thank you

  • @audiv4203
    @audiv4203 ปีที่แล้ว +1

    Thanks Mam.. U have helped me save a lot of time in handling this usecase.

    • @ThinkConstructive
      @ThinkConstructive  ปีที่แล้ว +1

      Glad it is helpful for you.
      Please share with others too 😊

  • @zuberdiwan8123
    @zuberdiwan8123 ปีที่แล้ว +1

    Very Usefull..Thanks For Sharing Mam.....Very Informative Content.

    • @ThinkConstructive
      @ThinkConstructive  ปีที่แล้ว +1

      Thank you so much 😊
      Please share with others too.

  • @tomermadmon3252
    @tomermadmon3252 2 ปีที่แล้ว +4

    Hi
    Your explanation is very clear.
    I have few questions..
    Why don't you just create generic object contains T response, String status and String message? In addition, you can use Lombok builder or to implement builder by yourself..

    • @ThinkConstructive
      @ThinkConstructive  2 ปีที่แล้ว +3

      Hi,
      Thanks 😊
      There are different ways to do this. I discussed one of them. Lombok and Generics can be another way to do this.

  • @indikakumarasinghe4792
    @indikakumarasinghe4792 หลายเดือนก่อน +1

    Excellent

    • @ThinkConstructive
      @ThinkConstructive  19 วันที่ผ่านมา +1

      Thank you so much 😀
      Stay connected and please share with others too 😊

  • @debanathswain81
    @debanathswain81 9 หลายเดือนก่อน

    Thank you ma'am for your awesome lecture very well explained

  • @user-lw2jn8gp3e
    @user-lw2jn8gp3e ปีที่แล้ว +2

    i learned a lot from you madam ji, tqsm🌹

    • @ThinkConstructive
      @ThinkConstructive  ปีที่แล้ว +2

      Thank you so much 😊
      Stay connected and please share with others too.

    • @user-lw2jn8gp3e
      @user-lw2jn8gp3e ปีที่แล้ว

      could you please make a video about oauth2 with okta using springboot asap ,its help me alot for me ,you are my savior@@ThinkConstructive

  • @nawwintphyu1873
    @nawwintphyu1873 10 วันที่ผ่านมา +1

    Thank you so much!

    • @ThinkConstructive
      @ThinkConstructive  3 วันที่ผ่านมา +1

      Most Welcome ❤️
      Please stay connected and share channel details with others too, thanks 😊

  • @boxofgames3
    @boxofgames3 ปีที่แล้ว +2

    great mam, clear explanation

  • @yarraravitejaskpbpmlule2867
    @yarraravitejaskpbpmlule2867 2 ปีที่แล้ว +2

    Hi can you make session on
    Spring security
    For enterprise level application
    That would be helpful for me and my friends
    Who are working on the project
    Thanks in anticipation
    Yarra Raviteja

    • @ThinkConstructive
      @ThinkConstructive  2 ปีที่แล้ว +2

      Hi,
      Sure, I will include Spring Security in my plan.
      Thanks

  • @1313durgesh
    @1313durgesh ปีที่แล้ว +1

    Great Teaching way

    • @ThinkConstructive
      @ThinkConstructive  ปีที่แล้ว +1

      Thanks 😊
      Stay connected and please share with others too 😊

  • @purnimakumari7735
    @purnimakumari7735 9 หลายเดือนก่อน +1

    Thank you for knowledge sharing

    • @ThinkConstructive
      @ThinkConstructive  9 หลายเดือนก่อน +2

      Thanks 😊
      Stay connected and please share with others too 😊

    • @purnimakumari7735
      @purnimakumari7735 8 หลายเดือนก่อน

      @@ThinkConstructive yes sure

  • @baharmahammad6566
    @baharmahammad6566 9 หลายเดือนก่อน

    Awesome tutorial. What about getting back all cloud vendors in the form of an array plus status and message?

  • @narendra8341
    @narendra8341 ปีที่แล้ว +2

    could you please give me one session about doing Json Pars in spring boot application and simplifies?

  • @DeepakLalchandaniProfile
    @DeepakLalchandaniProfile 2 ปีที่แล้ว +3

    Hi, where to learn Spring from ? Do you have a youtube video for that

    • @ThinkConstructive
      @ThinkConstructive  2 ปีที่แล้ว +1

      Hi,
      Currently, I don't have Spring framework video available on my channel. That will surely be available in future here.
      Meanwhile, you can refer "spring.io/" website and also can read book - "Spring in Action" by Manning publication.

    • @DeepakLalchandaniProfile
      @DeepakLalchandaniProfile 2 ปีที่แล้ว +1

      @@ThinkConstructive thanks for your reply

    • @DeepakLalchandaniProfile
      @DeepakLalchandaniProfile ปีที่แล้ว

      @@ThinkConstructive which is the best book that you would suggest for Spring Boot. Please reply

  • @oligooliogo961
    @oligooliogo961 ปีที่แล้ว +2

    Hi how can we write the responses for each endpoint in a file and put it in folder resources..thanks

    • @ThinkConstructive
      @ThinkConstructive  ปีที่แล้ว +1

      Hi,
      resource folder file needs to be read by response provider and use appropriate response in ResponseHandler.responseBuilder (message.

  • @rahulbasutkar04
    @rahulbasutkar04 2 หลายเดือนก่อน +1

    Thank you mam

    • @ThinkConstructive
      @ThinkConstructive  2 หลายเดือนก่อน +1

      Most welcome 😊
      Please share with others too

  • @sebastiansagrario8684
    @sebastiansagrario8684 ปีที่แล้ว +2

    its ok to return null as a responseObject and a status code 404 when you cant find that object in the database? thanks you!

    • @ThinkConstructive
      @ThinkConstructive  ปีที่แล้ว +2

      Best practice is to return a proper response message back for example - "Request data does not exist" with status code 404

    • @mohanvs-msv
      @mohanvs-msv 2 หลายเดือนก่อน

      @@sebastiansagrario8684 Use the following Java annotations on top of the the Response handler class. @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) and @JsonSerialize(include = JsonSerialize.Inclusion.NON_EMPTY)
      Which will elemenate the Null and Empty values in the output, but make sure that you also use the field validation annotations to don't miss out the mandate fields.
      This might be helpful for you..! Happy Learning.. 😊

  • @rajdeepsinghrathore7337
    @rajdeepsinghrathore7337 8 หลายเดือนก่อน

    Very very helpful.Thanks

  • @sayyadaareesh9373
    @sayyadaareesh9373 11 หลายเดือนก่อน

    Hello ma'am
    I think you also perform change on service package like CloudVendorService and it's implementation class because this method comes from service package.
    Thank you.

    • @sayyadaareesh9373
      @sayyadaareesh9373 11 หลายเดือนก่อน

      Perform change on method signature

  • @naveenkoduru1328
    @naveenkoduru1328 ปีที่แล้ว +3

    👍

  • @ganeshgani810
    @ganeshgani810 ปีที่แล้ว +1

    Thanks a lot 🙌🙌

    • @ThinkConstructive
      @ThinkConstructive  ปีที่แล้ว +1

      Welcome😊 Stay connected
      Please share with others too.

  • @giangnguyenthetruong3896
    @giangnguyenthetruong3896 ปีที่แล้ว +1

    Using ResponseEntity or using custom responses, which one is better ?

    • @ThinkConstructive
      @ThinkConstructive  ปีที่แล้ว +1

      For providing customise responses as discussed in the session, Custom response handling is better otherwise simple ResponseEntity is sufficient. It depends on the requirement.

  • @rhodesjh
    @rhodesjh 11 หลายเดือนก่อน

    Thanks for this. How do we get the same kind of Json response for getAllCloudVendorDetails?

    • @rhodesjh
      @rhodesjh 11 หลายเดือนก่อน

      I will get each cloud from the list and send it to the response entity and return ?

    • @rhodesjh
      @rhodesjh 11 หลายเดือนก่อน

      I did this and it worked!
      public List getAllCloudVendorDetails(){
      //return new CloudVendor("C1","Vendor name","Address one","xxxxxxx");
      List list = cloudVendorService.getAllCloudVendors();
      List newList = new ArrayList();
      for (CloudVendor cloudVen : list){
      System.out.println(cloudVen + "");
      newList.add(ResponseHandler.responseBuilder
      ("Response Vendor details are given here", HttpStatus.OK,cloudVen));
      }
      return newList;

  • @mostviewedtoks
    @mostviewedtoks ปีที่แล้ว +1

    thank you

  • @nightcorerelax2560
    @nightcorerelax2560 ปีที่แล้ว +2

    so good