#14 Spring MVC and Layers

Поділитися
Вставка
  • Опубліковано 30 січ 2025

КОМЕНТАРІ • 124

  • @jairramirez6900
    @jairramirez6900 7 місяців тому +13

    Thank you for sharing not just the results but the errors, it's good to see how somebody with good knowledge in programming deals with errors

  • @ЕвгенийВовк-ы7ь
    @ЕвгенийВовк-ы7ь 7 місяців тому +18

    Thank you so much for the error demonstration.
    It is very important for me!
    It shows that you don't have to be afraid of mistakes, you just have to deal with them.
    This video is very valuable!🙏

  • @yashwanthraj1146
    @yashwanthraj1146 8 місяців тому +53

    Spring made programming easy ❌ TELUSKO made Spring easy ✅

  • @ameybhandari6865
    @ameybhandari6865 7 місяців тому +6

    Hello Navin sir, this playlist is going very well, usually I dont comment on videos, however the kind of dedication you are taking and the content that you are making is mind blowing. Thank you for this and keep uploading. We are waiting to learn these things.

  • @premnath9727
    @premnath9727 6 місяців тому +31

    The problem why lombok is not working is due to IDE. Intellij doesn't understand the lombok features i.e getters , setters , constructors predefined method. To solve this error you need to install Lombok Plugin in your Intellij IDE

  • @Devivl
    @Devivl 5 місяців тому +4

    You don't teach, you educate! Thank you!

  • @justicefor_sandwichlord
    @justicefor_sandwichlord 3 місяці тому +2

    Bro's Teaching everything
    that's soooooo gooood
    goood to know how things work behind the scene so we can fix bugs pretty quickly

  • @lootster
    @lootster 4 місяці тому +1

    00:03 Understanding request mapping in Spring MVC
    01:54 To send data from server to client in a suitable format.
    03:40 Creating a class to represent a product with specific attributes
    05:37 Introducing service layer in Spring MVC for separate business logic
    07:23 Creating package structure and defining service methods
    09:31 Troubleshooting port number issues in Spring MVC
    11:29 Implementing Spring MVC logic
    13:38 Troubleshooting issues with port number and code errors
    16:10 Testing APIs using different tools and understanding API usage

  • @sachinmehra-bt7jj
    @sachinmehra-bt7jj 5 місяців тому +6

    @Telusko Sir, The issue your are facing that port is already in use is because your SpringBoot application re run automatically so when you are trying to run it again it gave you that error .So you don't have to re run it Sir. 😊

    • @javidashwaqf
      @javidashwaqf 2 місяці тому

      the actual problem is on place of restart if we run the already running program means it open in new terminal that's the issue

  • @RamyaK-j6t
    @RamyaK-j6t Місяць тому

    You are a Master Educator! And I am Lucky to learn from you Sir! Love from Tamilnadu ❤

  • @pk_hash
    @pk_hash Місяць тому

    First of all, this is an excellent video. Many thanks to Telusko! Here, the @Component annotation in the Product class is the root cause of the problem. Any class with the @Component annotation is asked to have its "Bean" managed by Spring. To put it another way, we request that Spring generate a "Singleton" instance of this class that may be injected into other classes or components.

  • @abishekmagar8790
    @abishekmagar8790 7 місяців тому +2

    You're amazing Sir. King of Java

  • @likithkumar3212
    @likithkumar3212 5 місяців тому +1

    its teaching....it's a style of teaching... helps a lot 😍

  • @naraynwetal6544
    @naraynwetal6544 6 місяців тому

    I really appreciate your hard work in creating such simple yet valuable content in your videos.

  • @kushal6065
    @kushal6065 5 місяців тому +1

    Thanks please don't stop making videos. I need it for my finaly year project

  • @AjayKumar-go4jr
    @AjayKumar-go4jr 5 місяців тому +2

    spring made programming easy ❌ but he did... yes, Navin Reddy made programming easy 💥

  • @lokeshkumarkondeti4312
    @lokeshkumarkondeti4312 4 місяці тому +2

    @Telusko I've tried different ways about the issue that you got. So here is the solution other than restarting.
    As we are considering the Product as a simple model so it shouldn't have @Component annotation. So keep @Data annotation and execute it will work..
    Please correct me if I'm wrong..

    • @SHIVAMKUMAR-gj3td
      @SHIVAMKUMAR-gj3td 4 місяці тому

      Bruh, I tried with and without Lombok both and both were running good with having costructors and getter setters only, so, @Component was causing the issue, but I wanna know why?
      Don't we need an object of Product inside our IoC container?

    • @lokeshkumarkondeti4312
      @lokeshkumarkondeti4312 4 місяці тому

      ​@@SHIVAMKUMAR-gj3tdHere the Product model is not managed by Spring IoC bcz we are instantiated manually in ProductService class.
      If we wanna make it handle by the spring IoC then
      we have to create a configuration class and write the list there and call them in the ProductService constructor .
      If needed we have to use @comoonentScan annotation to scan for components...
      Note: I took help of copiolot to get the clear info

    • @pk_hash
      @pk_hash Місяць тому

      ​@@SHIVAMKUMAR-gj3td Here, the @Component annotation in the Product class is the root cause of the problem. Any class with the @Component annotation is asked to have its "Bean" managed by Spring. To put it another way, we request that Spring generate a "Singleton" instance of this class that may be injected into other classes or components. Hope this helps.

  • @arturkwiatkowski5019
    @arturkwiatkowski5019 3 місяці тому

    This time your code works for me. I face strange issues sometime and most of the time reset of Intellij fix the problem.

  • @Aaaronka
    @Aaaronka 8 місяців тому

    You're very good at teaching. I can't wait for the next lesson!

  • @rohittripuraneni966
    @rohittripuraneni966 3 місяці тому

    Thank you for making it easier to understand.

  • @AkashKumar10134
    @AkashKumar10134 4 місяці тому

    you could have just ran this in the cmd "netstat -ano | findstr :", which will provide you the port id and with port id you can stop the server port which was already running due to another console by following command "taskkill /PID /F" , andd its done the server port is no more running and ready to use for a new application.

  • @DanaO-su6xl
    @DanaO-su6xl 7 місяців тому

    Thank you for this video! Everything worked on my machine as well!

  • @PawanKumarRacha
    @PawanKumarRacha Місяць тому

    For these problem you need to go setings in that build ->compile-> Annotation process you need enable the obtained 2nd option then Lombok will work all problems solve

  • @DevGhost97
    @DevGhost97 2 місяці тому

    Thank you sir
    Please continue this series

  • @Yogesh-p3k
    @Yogesh-p3k 4 місяці тому

    You are Good...!!
    Explanation is Amazing!

  • @dragoon4060
    @dragoon4060 8 місяців тому

    Thank you for this video! Everything worked on my machine!

  • @stephena1156
    @stephena1156 5 місяців тому +1

    Multiple server instant have already been created and didn't stop properly.
    If you're using windows, type below command in cmd
    netstat -aon | find /i "listening" | find "your_port_no"
    Hit the enter button and then,
    Taskkill /F /PID "type_PID_id_of_current_port" and then hit enter
    If you're using linux
    ps -aux | grep tomcat
    kill -9 TYPE_YOUR_PID_ID
    Hope it will work

  • @user-cd8cg3yr1q
    @user-cd8cg3yr1q 7 місяців тому

    Thank you for the great video . please keep uploading more such kind of videos

  • @GuessGameFun
    @GuessGameFun 6 місяців тому

    Wow. amazing videos. Thank you for the videos Sir

  • @gonzalob.2428
    @gonzalob.2428 7 місяців тому

    Hi Navin!!!... the lombok works normally in my machine and it's typically you need to restart you system.

  • @sonusangwan326
    @sonusangwan326 8 місяців тому +1

    Hi Sir, please upload videos on regular basis.

  • @sonusangwan326
    @sonusangwan326 8 місяців тому

    Your content is superb✌️

  • @shakthiviviyn
    @shakthiviviyn 6 місяців тому

    THANKS FOR THIS AMAZING VIDEO!!! THANKS TELUSKO

  • @NandinerdeneMandakh
    @NandinerdeneMandakh 5 місяців тому

    Appreciate your every video! Thank you

  • @orekisday
    @orekisday 8 місяців тому

    These vids are amazing. More uploads please

  • @shaurya2608
    @shaurya2608 2 місяці тому +1

    Thank you

  • @deshdeepaksingh1182
    @deshdeepaksingh1182 7 місяців тому

    these videos are really helpful

  • @Gooblehusain
    @Gooblehusain 2 місяці тому

    int not found because you declare model as component, so your container trying to initiate it but failed because it didn't know what int that should be used. You can remove the error, by removing @component or adding empty constructor and thus give your container ability to initiate model but using default primitive values.

  • @chen8996
    @chen8996 4 місяці тому

    Really good lessons, keep updating please

  • @RealRameshBabu
    @RealRameshBabu 6 місяців тому

    For lombok, I think we need to install that lombok plugin from intellij marketplace and also that configure plugin shown at bottom right 5:13 needs to be clicked

  • @KarnanV-j7j
    @KarnanV-j7j Місяць тому

    Why are we considering using another version of the Lombok dependency? Sir, I believe the issue lies with the current version.

  • @akashjaiswal696
    @akashjaiswal696 8 місяців тому

    Great explanation, upload more lectures

  • @kishanrawatxo
    @kishanrawatxo 8 місяців тому

    Thank you sir for video ❤

  • @naraynwetal6544
    @naraynwetal6544 6 місяців тому

    Really lot of fun sir to learn spring boot

  • @Jenisha-tv2mi
    @Jenisha-tv2mi 5 місяців тому

    Appreciate the efforts!

  • @movi_u
    @movi_u 4 місяці тому

    Love your videos!

  • @Sidex150-g1p
    @Sidex150-g1p 5 місяців тому

    This is premium level content for free NGL

  • @Alcatraz-23
    @Alcatraz-23 7 місяців тому

    Top notch content!!

  • @vishaldindalkop294
    @vishaldindalkop294 6 місяців тому

    Thank you for the video.

  • @cheguevara1396
    @cheguevara1396 5 місяців тому

    Great work sir

  • @sayansamanta5458
    @sayansamanta5458 25 днів тому

    best teatcher ever

  • @tarunkumarvella9157
    @tarunkumarvella9157 4 місяці тому

    In IntelliJ we have to enable runtime settings for lambok

  • @varunpalsingh3822
    @varunpalsingh3822 7 місяців тому

    thank you sir 🙂

  • @vaibhavmishra9890
    @vaibhavmishra9890 6 місяців тому

    make a default constructor in product for removing the error.

  • @JoshTonyKlementJ
    @JoshTonyKlementJ 8 місяців тому

    Nice Video Sir Thank You

  • @samplayz9557
    @samplayz9557 4 місяці тому

    you have to add lombok plugin to solve this issue

  • @pavankumar5449
    @pavankumar5449 7 місяців тому

    Lombok will work but use the annotations called @Setter and @Getter

  • @athulraghu9338
    @athulraghu9338 22 дні тому

    Don't add @Component annotation for Product class, it will cause issues.

  • @vajrakowtilyab4822
    @vajrakowtilyab4822 5 місяців тому

    Thank you SIR

  • @johnrusselledomingo170
    @johnrusselledomingo170 7 місяців тому

    Thank you

  • @aishwaryasutar9042
    @aishwaryasutar9042 4 місяці тому

    @Telusko , Amazing videos ! I was facing the same port issue while working with eclipse and I tried terminating that port exclusively and then restarting my java code, it works :) Command - lsof -i :8080 , then kill -9 Hope it works for you !

  • @pawarswapnil97
    @pawarswapnil97 6 місяців тому

    thank you!

  • @suryavamsi3680
    @suryavamsi3680 8 місяців тому

    as it's taking time to upload videos, is there any other way that we can learn it fast?
    i mean any course in udemy?

  • @JayJayJay007
    @JayJayJay007 5 місяців тому

    Great video

  • @112yt
    @112yt 5 місяців тому

    need a separate video for Lombok please!

  • @harshakkrishnaa2014
    @harshakkrishnaa2014 8 місяців тому

    Awesome video

  • @ShamanthAchar-u4f
    @ShamanthAchar-u4f 5 місяців тому

    Telusko ❤

  • @DatHua-q3p
    @DatHua-q3p 4 місяці тому

    good job

  • @Wisewolf09
    @Wisewolf09 6 місяців тому

    Same error was popping up in my machine server busy. I did this in command panel
    Step 1 = fuser 8080/tcp (check port running on localhost 8080)
    Step 2 = fuser -k 8080/tcp (To kill 8080)

  • @sonusangwan326
    @sonusangwan326 8 місяців тому

    Hi Sir, why are we using @Component annotation on Product class? We are not using it as a bean.

    • @kunalchhablani4549
      @kunalchhablani4549 8 місяців тому

      for modularity and encapsulation

    • @sonusangwan326
      @sonusangwan326 8 місяців тому

      How is that related here?

    • @code_manthra
      @code_manthra 4 місяці тому

      @Component is not necessary for Product class in this case, as we r manually creating object using new keyword inside Arrays.asList method

  • @Rocky4375-v9y
    @Rocky4375-v9y 7 місяців тому

    CFBR ❤

  • @kiranmarrapu
    @kiranmarrapu 20 днів тому

    I don't know the real reason for the Port number issue. It worked for me in the first attempt with Port number 8080.

  • @tampishach
    @tampishach 6 місяців тому

    Interestingly i was able to use lombok library

  • @pramodkajla
    @pramodkajla 3 місяці тому

    Looks like, You didn't enable Lombok IntelliJ plugin. You got popup to configure Lombok in intelliJ at 5.09 minute in video.

  • @truthbetold_25
    @truthbetold_25 6 місяців тому +1

    Getting an empty list on my browser. Any suggestions to fix this?

    • @carinacodrea2738
      @carinacodrea2738 5 місяців тому +1

      The issue you're facing, where the response shows [{}, {}, {}] instead of the actual properties and values of the Product objects, is likely due to how the Product class is being serialized into JSON. By default, Jackson (the JSON library used by Spring Boot) serializes objects by their getters. So you need to create getter methods for all of the properties inside the Product class,or add @Getter lombok annotation :
      @Component
      @AllArgsConstructor
      @NoArgsConstructor
      @Getter
      public class Product {
      private int id;
      private String name;
      private double price;
      }

  • @JenHsingHuang
    @JenHsingHuang 7 місяців тому

    I also had the issue with IntelliJ, 8080 still in use... that's annoying lol

  • @kilarivinaykumar8715
    @kilarivinaykumar8715 Місяць тому

    Hey fellow alien, lombok works fine in my machine in Intellij Ultimate.

  • @sandeep1727
    @sandeep1727 7 місяців тому

    Im getting this error "Consider defining a bean of type 'int' in your configuration."

  • @killheist173
    @killheist173 8 місяців тому

    No sir Initially, lombok was not working for me as well, but after making some changes to the settings in Eclipse, it is working properly right now.

  • @SaranyaReddy-n8g
    @SaranyaReddy-n8g 25 днів тому

    Lombok is not working for you because you need to enable lombok in your IDE

  • @KaturuRakesh
    @KaturuRakesh 4 місяці тому

    int range exceed

  • @sreerajrajeevan3389
    @sreerajrajeevan3389 7 місяців тому

    lombok library is always a problem for me as well

  • @pawana2116
    @pawana2116 8 місяців тому

    Lombok dependency problem sir

  • @sasikumar4183
    @sasikumar4183 Місяць тому

    🎉

  • @theCHAD_666
    @theCHAD_666 8 місяців тому

    ❤❤❤❤❤

  • @AimanNorhisham-l2m
    @AimanNorhisham-l2m 4 місяці тому

    nice!

  • @harshalashi
    @harshalashi 6 місяців тому +1

    I am getting blank json. Please help

    • @deepak_jain
      @deepak_jain 5 місяців тому +1

      Even I was facing the same issue.
      package com.example.demo.model;
      import org.springframework.stereotype.Component;
      @Component
      public class Product {
      private int prodId;
      private String pName;
      private int price;
      // Default constructor
      public Product() {}
      // Parameterized constructor
      public Product(int prodId, String name, int price) {
      this.prodId = prodId;
      this.pName = name;
      this.price = price;
      }
      // // Getters and setters
      public int getProdId() {
      return prodId;
      }
      //
      // public void setProdId(int prodId) {
      // this.prodId = prodId;
      // }
      //
      public String getpName() {
      return pName;
      }
      //
      // public void setpName(String pName) {
      // this.pName = pName;
      // }
      //
      public int getPrice() {
      return price;
      }
      //
      // public void setPrice(int price) {
      // this.price = price;
      // }
      }

    • @Rohit-ft6qt
      @Rohit-ft6qt 5 місяців тому

      @@deepak_jain i am facing application failed to start

    • @extrimgaming3891
      @extrimgaming3891 4 місяці тому +1

      Same issue any solution to this

    • @extrimgaming3891
      @extrimgaming3891 4 місяці тому +1

      ​@@deepak_jainsame issue

    • @extrimgaming3891
      @extrimgaming3891 4 місяці тому

      @telusko

  • @Vishwa_Dilum
    @Vishwa_Dilum 4 місяці тому

    💝

  • @dumydumydumy
    @dumydumydumy Місяць тому

    5.09

  • @pranaypaul6361
    @pranaypaul6361 7 місяців тому

    layers simplified

  • @MaximusHyde
    @MaximusHyde 7 місяців тому

    sudo lsof -nP -iTCP -sTCP:LISTEN

  • @Gogul-ub4ll
    @Gogul-ub4ll 8 місяців тому

    Please daily upload video sir... what happened to you 😢

  • @GaryLee-j2v
    @GaryLee-j2v 4 місяці тому

    Lewis Ruth Young Shirley Robinson Richard

  • @based-david
    @based-david 6 місяців тому

    wass here

  • @juggernautthug6855
    @juggernautthug6855 4 місяці тому

    ncccccceeeeeeeeeeeeee

  • @prashantsharma4525
    @prashantsharma4525 2 місяці тому

    thank you

  • @TirthPrajapati-by9mu
    @TirthPrajapati-by9mu 8 місяців тому

    ❤❤❤