Spring Boot User Registration and Login Tutorial with MySQL Database, Bootstrap and HTML5

Sdílet
Vložit
  • čas přidán 5. 09. 2024
  • In this video, I'd like to guide you guys through the process of developing a Java web application based on Spring framework using Spring Boot. You will learn how to develop user sign up (registration) module and user authentication (login) module with Spring Security.
    Technologies: Spring Web MVC, Spring Data JPA & Hibernate, Spring Security, Thymeleaf, Bootstrap (webjars), JUnit Jupiter & AssertJ, MySQL database.
    Software programs: Java Development Kit (JDK), Spring Tool Suite IDE (STS), MySQL database server & MySQL Workbench.
    Here are the steps you will see in order to build a Spring Boot web application with user registration and login:
    - Create Project & Configure Dependencies
    - Configure Data source & Create Database
    - Code Entity class & Repository interface
    - Write Unit Test (test create user)
    - Code Spring MVC Controller class
    - Code Registration Form & use Bootstrap
    - Code Custom UserDetails and UserDetailsService classes
    - Configure Spring Security for authentication
    - Code List Users page & Logout
    Take Spring Boot E-Commerce Ultimate Course to Learn to Build a complete shopping website using Java, Spring Boot, Thymeleaf, Bootstrap, jQuery and MySQL database: www.udemy.com/...

Komentáře • 73

  • @tejaskadam23
    @tejaskadam23 Před měsícem +1

    Nice knowledgefull vedio, please keep your thumbnails appealing and engaging, you have good content.

  • @arulprakasan1697
    @arulprakasan1697 Před 6 měsíci

    Wow interesting !! before fully watching this video am commenting !! you are always great !! you know how perfectly teach others !!!

    • @CodeJava
      @CodeJava  Před 5 měsíci

      Thank you so much 😀

  • @patkoxx
    @patkoxx Před 7 měsíci +3

    Good stuff. WebSecurityConfigurerAdapter does not exist anymore in latest Spring, so you should update this tutorial.

    • @CodeJava
      @CodeJava  Před 7 měsíci +2

      check out my update in this video: czcams.com/video/cwcfHwA9-nw/video.html - and in this one: czcams.com/video/7HQ-x9aoZx8/video.html

  • @user-xf5ir4fg7s
    @user-xf5ir4fg7s Před 9 měsíci

    thank bro,very very help ful videos,please keep on posting videos ,thank you very much bro,love your videos

    • @CodeJava
      @CodeJava  Před 9 měsíci

      It's my pleasure. Thanks for watching :)

  • @user-zs6fu2qv5s
    @user-zs6fu2qv5s Před 9 měsíci

    Great! Tks so much! (nếu có tiếng Việt thì sẽ tốt hơn cho người mới bắt đầu)

  • @hakeemh6675
    @hakeemh6675 Před 4 měsíci

    Great Tutorial! Just wondering do you have a Tutorial or explanation for recovering forgotten passwords? Thanks

    • @CodeJava
      @CodeJava  Před 4 měsíci

      yes, I have. Check that video here: czcams.com/video/znF8QMWWDlE/video.html

    • @hakeemh6675
      @hakeemh6675 Před 4 měsíci

      @@CodeJava thank you

  • @mdshahbaz129
    @mdshahbaz129 Před 10 měsíci +2

    the functionality of spring security is been changes now

    • @CodeJava
      @CodeJava  Před 10 měsíci

      Right. Check my update here: www.codejava.net/frameworks/spring-boot/fix-websecurityconfigureradapter-deprecated

  • @badushabasheer4494
    @badushabasheer4494 Před 10 měsíci +1

    can you please make a video on OTP login in spring boot.

    • @CodeJava
      @CodeJava  Před 10 měsíci

      check this video: czcams.com/video/uceE4RILLwc/video.html

  • @victorciugureanu4878
    @victorciugureanu4878 Před měsícem

    Hi , can you help with this eror please : (java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration) , its show when I run the Test method. Thanks

  • @Usha1506
    @Usha1506 Před 6 měsíci

    While creating web security config class, I can’t find the web security configurer adapter interface . How to get that in interfaces.

    • @CodeJava
      @CodeJava  Před 6 měsíci

      it is removed in new version of Spring Security. Check out my updates in the written tutorial: www.codejava.net/frameworks/spring-boot/user-registration-and-login-tutorial

  • @thesongsof..........7783
    @thesongsof..........7783 Před 6 měsíci

    very nice

    • @CodeJava
      @CodeJava  Před 6 měsíci

      Thanks. Glad it's helpful.

  • @javascratchexpertise
    @javascratchexpertise Před 6 měsíci

    After clicking finish I am getting error in application that springframework is not imported

    • @CodeJava
      @CodeJava  Před 6 měsíci

      can you share the error in detailed (full exception)???

  • @thesongsof..........7783
    @thesongsof..........7783 Před 6 měsíci

    sir can you make a simple video that is deploy a spring boot website
    which is make in thymleaf and spring boot
    i search all youtube but i not found a video according my requirment
    nowdays I make a website using spring boot in templates i use thymleaf
    plz can you help me for deploy a project

    • @CodeJava
      @CodeJava  Před 6 měsíci

      you can deploy your Spring Boot app with Heroku or AWS. Check my video:
      czcams.com/video/OrpRybZjDSY/video.html and this one: czcams.com/video/TixLbON3TR8/video.html

  • @user-ep7sh4km7j
    @user-ep7sh4km7j Před 7 měsíci

    my testing keeps on failing saying this.srepo(the object of student repository is null)
    java.lang.NullPointerException: Cannot invoke "com.example.Project1.repository.StudentRepository.save(Object)" because "this.Srepo" is null
    at com.example.Project1.test.StudentRepositoryTest.testCreateStudent

    • @CodeJava
      @CodeJava  Před 6 měsíci

      missing @Autowired annotation for the Srepo variable?

  • @nikitam8018
    @nikitam8018 Před 6 měsíci

    I have done with register_sucess.html but it was not showing in webpage
    Its shows like whitepage error

    • @CodeJava
      @CodeJava  Před 6 měsíci

      it seems that you get 404 or 500 error. Can you share the detailed error so I can know the exact reason?

    • @nikitam8018
      @nikitam8018 Před 6 měsíci

      @@CodeJava Actually i was getting error in CustomerUserDetails class and from there i was not able to run application.
      i was getting as repo.save is null and having null pointer exception

  • @user-ux9bj9pj6w
    @user-ux9bj9pj6w Před 7 měsíci

    Hi, I have failed in my Junit Test, would you please help me to fixt it.

    • @CodeJava
      @CodeJava  Před 7 měsíci

      can you describe the error in detailed? with full exception stack.

  • @swadhinmohanty3980
    @swadhinmohanty3980 Před 7 měsíci

    sir I didn't found the project can you please suggest me where it is?

    • @CodeJava
      @CodeJava  Před 7 měsíci

      you can get the code on GitHub here: github.com/codejava-official/spring-boot3-registration-login

  • @mohammadwaseem8824
    @mohammadwaseem8824 Před 10 měsíci

    WebsecurityConfigureAdapter is not working in eclipse

    • @CodeJava
      @CodeJava  Před 10 měsíci

      check out my solution here: www.codejava.net/frameworks/spring-boot/fix-websecurityconfigureradapter-deprecated

  • @TheProfessorchaos101
    @TheProfessorchaos101 Před 8 měsíci

    Hello! While creating a new Spring Starter Project, the only two Java versions are 21 and 17. Is this okay to continue?

    • @CodeJava
      @CodeJava  Před 8 měsíci

      that's okay, as Java 21 is the current LTS (Long Term Support) release.

    • @TheProfessorchaos101
      @TheProfessorchaos101 Před 8 měsíci

      Thanks! I paused the project right before creating the second test in the test class to validate email and all entries from db are gone/dropped and I am not prompted to sign in Local host 8080. Should I modify pom.xml again or how can I resume the project? @@CodeJava

  • @chihienle8747
    @chihienle8747 Před 4 měsíci

    why i don't have bootstrap-4.3.1.jar ?

    • @CodeJava
      @CodeJava  Před 4 měsíci

      did you add the dependency for Bootstrap and Web JARS. This video may help: czcams.com/video/PF66wvgiF90/video.html

    • @chihienle8747
      @chihienle8747 Před 4 měsíci

      I fixed the error three days ago
      But anyway, thank you for guiding me

  • @VAService-zb5im
    @VAService-zb5im Před 8 měsíci

    hii there how can i convert the front end to vaadin?

  • @visvasnagarajan6693
    @visvasnagarajan6693 Před 4 měsíci

    Hi I am getting this error while running the tests.

    • @visvasnagarajan6693
      @visvasnagarajan6693 Před 4 měsíci

      20:58:04.307 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [com.moviereview.Movie.Review.login.UserRepositoryTests]: UserRepositoryTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
      20:58:04.717 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Found @SpringBootConfiguration com.moviereview.Movie.Review.MovieReviewApplication for test class com.moviereview.Movie.Review.login.UserRepositoryTests
      20:58:04.908 [main] INFO org.springframework.boot.devtools.restart.RestartApplicationListener -- Restart disabled due to context in which it is running

    • @CodeJava
      @CodeJava  Před 4 měsíci

      check the package structure of the test class. Make sure it is in the same package hierarchy as the main class so Spring configuration will be loaded. Otherwise you need to use the @Import(Class) annotation.

  • @mohamedlarbi8842
    @mohamedlarbi8842 Před 6 měsíci

    how i can define my login template ?

    • @CodeJava
      @CodeJava  Před 6 měsíci

      follow this video: czcams.com/video/RhIXP5tjHkk/video.html

  • @russellandrady
    @russellandrady Před 3 měsíci

    Sir do this have JWT token?

    • @CodeJava
      @CodeJava  Před 3 měsíci

      no, it doesn't. For JWT authentication, kindly check this video: czcams.com/video/S7jV6di6Pl0/video.html

  • @dcaPRAVEENKUMARJ
    @dcaPRAVEENKUMARJ Před 10 měsíci

    Restaurant project model video was upload

  • @kadiyalamadhavan7136
    @kadiyalamadhavan7136 Před 9 měsíci

    Could you please upload it in git gub this entire file

    • @CodeJava
      @CodeJava  Před 9 měsíci

      you can get the full project code in this article: www.codejava.net/frameworks/spring-boot/user-registration-and-login-tutorial

  • @sujitwaghmare3546
    @sujitwaghmare3546 Před 3 měsíci

    want to download this project

    • @CodeJava
      @CodeJava  Před 3 měsíci

      you can download the project attached in this article: www.codejava.net/frameworks/spring-boot/user-registration-and-login-tutorial

  • @user-pw2rl9kw1j
    @user-pw2rl9kw1j Před 9 měsíci

    please can you share your code as a zip file . thanks a lot

    • @CodeJava
      @CodeJava  Před 9 měsíci

      you can get the code in the written article at www.codejava.net/frameworks/spring-boot/user-registration-and-login-tutorial

  • @bunty6999
    @bunty6999 Před 2 měsíci

    Wow terrific English accent you had . I didn't even understand anything you say dude. Can't you pronounce the words clearly

    • @CodeJava
      @CodeJava  Před 2 měsíci

      sorry to hear that, I will improve my accent in future videos.

  • @manhtritran51
    @manhtritran51 Před 2 měsíci

    are you Vietnamese ?

    • @CodeJava
      @CodeJava  Před 2 měsíci +1

      yes, I am. And welcome to my channel !

  • @mdshahbaz129
    @mdshahbaz129 Před 10 měsíci +2

    this is old video

    • @CodeJava
      @CodeJava  Před 10 měsíci +1

      Right. This video is restored from the old version which is removed by CZcams for ridiculous reason.

  • @truongquang3239
    @truongquang3239 Před 4 měsíci

    bảo sao cứ nghe ra accent như người Việt, hóa ra mình không sai ^^

    • @CodeJava
      @CodeJava  Před 4 měsíci

      kaka, có dễ nghe hơn english accent ko?

    • @truongquang3239
      @truongquang3239 Před 4 měsíci

      @@CodeJava dễ nghe hơn Eng accent anh ạ.. cơ mà cái 1:06:08 cái WebSecurityConfigurerAdapter của em không có, phải làm sao đây

  • @stavrosk8272
    @stavrosk8272 Před 9 měsíci

    Hi
    Why i get an error on this line?
    Welcome [[${#request.userPrincipal.principal.fullName}]]

    • @CodeJava
      @CodeJava  Před 9 měsíci

      check the class that implements UserDetails interface. It must declare getter getFullName().

    • @stavrosk8272
      @stavrosk8272 Před 9 měsíci

      @@CodeJava Thank you for replying i cannot get it to work i stil have teh same error