Это видео недоступно.
Сожалеем об этом.

How to integrate JQuery Ajax POST/GET & Spring MVC | Spring Boot | Java Techie

Поделиться
HTML-код
  • Опубликовано: 12 июн 2018
  • This Spring Boot Thymeleaf Ajax Example will shows you how to create a simple web application based on Spring Boot and Thymeleaf template + jQuery.ajax. Here, we are using jQuery.ajax function to send a request to Spring REST API and return a JSON response
    #JavaTechie #SpringBoot #Ajax #JQuery
    GitHub:
    github.com/Jav...
    Blogs:
    javagyanmantra...
    Facebook Group :
    / 919464521471923
    Like & Subscribe

Комментарии • 76

  • @PRASHANTKUMAR-wd9ww
    @PRASHANTKUMAR-wd9ww 6 лет назад +3

    Very Very Nice Video Basant...........really you are doing great job.And 1 more thing your explanation is very clear

  • @chintu_singh91
    @chintu_singh91 5 лет назад +1

    Don't know how did I miss to watch this one. Really great Basant Bhai, u r a #Gem

  • @AlokKumar-nd1tf
    @AlokKumar-nd1tf 5 лет назад +1

    Brother, I am big fan of Ur knowledge.. thanks for sharing ur knowledge with us. Keep it up..

  • @luchonoprograma203
    @luchonoprograma203 Год назад +2

    THANKS, THANKS VERY MUCH

  • @prasanjeetchakravarty6696
    @prasanjeetchakravarty6696 2 года назад +1

    Thank you for this video. its very helpful

  • @MilsonPazienza
    @MilsonPazienza Год назад +1

    I need it to my project I'll back here next week

  • @murilodemeloreis8210
    @murilodemeloreis8210 4 года назад

    Thank you
    Java Techie. Well done and very helpful!

  • @zzhyperr
    @zzhyperr 3 года назад +1

    gracias , thanks Techie !!

  • @maheshmuthangi613
    @maheshmuthangi613 3 года назад +1

    Thank you ❤️ java techie, if I get delete and update operations video or code that will be much better..

  • @maruthidanda2364
    @maruthidanda2364 2 года назад +1

    Super bro...

  • @Mohamed-uf5jh
    @Mohamed-uf5jh 5 лет назад +1

    very nice one! , thanks ,It's really a good Job

  • @gopald7263
    @gopald7263 6 лет назад +2

    Awesome..

  • @anujsinghsomvanshi3385
    @anujsinghsomvanshi3385 4 года назад

    Thank you so much bro. It was very helpful for me.

  • @rjcdz06
    @rjcdz06 5 лет назад +1

    Excellent! Thanks!

  • @rajenderprasad1193
    @rajenderprasad1193 5 лет назад +1

    Super Bhai

  • @wilmerfroilan8991
    @wilmerfroilan8991 6 лет назад +1

    Upload a video using spring security, auth with JWT, and RESTFul API for consume from the vuejs frontend, login page, register (user management), please master ;)

  • @peteradegboyega2555
    @peteradegboyega2555 2 года назад

    Many thanks for this. Pls how can I use Ajax/Restful Service to get book details by id and show results in html input.

  • @UTUBDZ
    @UTUBDZ 4 года назад +1

    Thank you for sharing such valuable content ! Can you give a hint on how to refresh data after adding/deleting to/from a table with Ajax ?

    • @Javatechie
      @Javatechie  4 года назад

      You need to do callback again to load all object , one more additional rest call to refresh

  • @ShinAkuma
    @ShinAkuma 4 года назад +1

    I'm having trouble with getRequest.
    When I click the button, the ajax is able to fetch the data from the controller, It displays "success" in the console along with the list of Book objects.
    But my DIV and UL inside it is not populated.
    What do I do ?

    • @Javatechie
      @Javatechie  4 года назад

      Did you added thymeleaf tag in your HTML head

  • @nirmalaramesh3258
    @nirmalaramesh3258 5 лет назад +1

    Hi thanks for the vedio
    Can u share vedio for file upload to database

  • @Rash1987nus
    @Rash1987nus 4 года назад

    please help..
    when i try run this project.... it is trying to create the bean .......trying to access the application.properties file and throwing the following error
    Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
    Reason: Failed to determine a suitable driver class

  • @53R61000
    @53R61000 3 года назад

    Hi, when I close the browser and open it again, the array of books is still loaded. Why?
    How can i fix it
    . Thanks!

  • @asitkumarsahu5211
    @asitkumarsahu5211 2 года назад +1

    @basant Can you tell me @modelAttribute in spring mvc support content type json during Ajax call which passing json data?

    • @Javatechie
      @Javatechie  2 года назад

      No @ModelAttribute won't work

  • @vijayakumarkrishnan9269
    @vijayakumarkrishnan9269 5 лет назад +1

    Very nice video altogether... Since I am new to Spring Boot it would be great if it has some more explanations on the mapping side...

    • @Javatechie
      @Javatechie  5 лет назад

      Planning to upload Spring boot tutorial from basic

  • @tw5529
    @tw5529 5 лет назад +1

    Awesome..... I used your code. But, after starting the server . when I am hitting localhost:8080/home ,the home page is not coming out. Only Whitelevel Error page is showing. What's the reason for this issue? Could you please let me know?

    • @Javatechie
      @Javatechie  5 лет назад +1

      Check the URL mapping .pass the proper URL

    • @tw5529
      @tw5529 5 лет назад

      @@Javatechie Using same url, which is used by u

  • @user-qk2xg1de4r
    @user-qk2xg1de4r 5 лет назад +1

    cool man

  • @zonic1456
    @zonic1456 5 лет назад

    Nice

  • @chucknorris8921
    @chucknorris8921 4 года назад +1

    Hello,
    I tried to run the code from your GitHub, and I get a 500 bad request error when I try to post/get the books. I didn't make any changes to the code. Could you give me any solution?

    • @Javatechie
      @Javatechie  4 года назад

      To get a book you need to fire Get request not post

    • @chucknorris8921
      @chucknorris8921 4 года назад +1

      @@Javatechie Thank you for your reply! I found the problem, it was because of the WebSecurity, I was not sending the CSRF token. :)

    • @Javatechie
      @Javatechie  4 года назад

      @@chucknorris8921 cool 👍

  • @shankeytyagi6428
    @shankeytyagi6428 5 лет назад +1

    Hi Prashant , Thanks for sharing the video. I am getting below error when I am trying to use your code in RestController : The constructor ServiceResponse(String, Book) is undefined. Can you help please . Waiting for your prompt reply.

    • @Javatechie
      @Javatechie  5 лет назад

      Do you have constructor in ServiceResponse class ? I used Lombok so used @AllArgsConstructor

    • @shankeytyagi6428
      @shankeytyagi6428 5 лет назад

      @@Javatechie Yes Prashant there is a constructor in ServiceResponse and I have also used the same Lombok, but it's still now working.

    • @Javatechie
      @Javatechie  5 лет назад

      Did you configured Lombok with your eclipse

    • @shankeytyagi6428
      @shankeytyagi6428 5 лет назад

      Yes I did Prashant

    • @SarthakGnR
      @SarthakGnR 3 года назад

      did you find the issue?

  • @PRASHANTKUMAR-wd9ww
    @PRASHANTKUMAR-wd9ww 6 лет назад +1

    Can you post Video On Integration Testing And 1 Video On Spring Oauth Security

    • @Javatechie
      @Javatechie  6 лет назад +1

      PRASHANT sure will upload

  • @asfaqahmed8947
    @asfaqahmed8947 4 года назад

    Why i am getting constructor proble in serviceresponse i import lombok and add all annotation that you have used

    • @Javatechie
      @Javatechie  4 года назад

      You should configure lombok in your eclipse ide

  • @russelllongo9182
    @russelllongo9182 4 года назад

    Hi, great tutorial learned a lot. However, no matter what I try (and I am new to all this) I cannot get around the HTTP 400 Bad Request, specifically " Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986". Doing some research online, more than a few Stack Overflow discussions on the error seem to point to newer versions of Tomcat not permitting certain characters in the HTTP request, such as {},[], and | characters. One solution suggested adding -Dtomcat.util.http.parser.HttpParser.requestTargetAllow=|{} to the VM start up, or adding it to Tomcat properties, but the first option didn't work, and wouldn't know how to set Tomcat properties for an embedded Tomcat server in a Spring eclipse project (don't see the files an external Tomcat would expose). Also, supposedly requestTargetAllow was deprecated apparently in the lastest versions. So not sure what to do at this point. Any suggestions??

    • @Javatechie
      @Javatechie  4 года назад

      Hi Russell , can you share your code in GitHub so that I can check this out

    • @russelllongo9182
      @russelllongo9182 4 года назад

      @@Javatechie Hi, I just sent a reply, hopefully you received it with the github link. But just in case github.com/rlongo-dev/demo
      I tried to copy your code exactly as you presented it, but there are a few changes i made after several errors.
      First, I kept getting errors that the server expected the controller for "saveBook" to be an HTTP GET request, which confused me. No matter what I tried, it seemed it would not accept a post, so I set the mapping to @GetMapping in class BookController, then changed the postrequest.js to use a Get. That got rid of the issue with expecting a GET.
      But then I got the HTTP 400 Bad Request, specifically " Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986" when it attempted the GET. I am not very familiar with Tomcat, but the stack overflow answers were claiming the {} brackets were unacceptable for Tomcat 8 and later?

  • @kongbullies6709
    @kongbullies6709 4 года назад +1

    have you done spring security login with ajax?

    • @Javatechie
      @Javatechie  4 года назад

      Using Ng http call I did not using ajax

    • @kongbullies6709
      @kongbullies6709 4 года назад +1

      @@Javatechie im having method not allowed 405 in my app, it's an ajax call login with spring security do you have any idea why this is happening?

    • @Javatechie
      @Javatechie  4 года назад +1

      Make sure to mention same http method in both client and server .
      Also inspect your browser and verify whethe initialr put call is happening from client or not

    • @kongbullies6709
      @kongbullies6709 4 года назад +1

      @@Javatechie put call meaning the put http method? i am using $.post in jquery

    • @Javatechie
      @Javatechie  4 года назад

      Yes put HTTP method to check cross origin

  • @manojraghvan8626
    @manojraghvan8626 10 месяцев назад

    Getting 500 error

  • @vinalpatel3269
    @vinalpatel3269 4 года назад +1

    how should I get this code?

    • @Javatechie
      @Javatechie  4 года назад

      GitHub link mentioned in video description you can download and reuse it

  • @kousikup23
    @kousikup23 4 года назад

    How to send multiple values to the controller

    • @Javatechie
      @Javatechie  4 года назад

      If you want to send multiple value then create a separate class and add attributes which you want to pass then do the post call

    • @kousikup23
      @kousikup23 4 года назад

      @@Javatechie Can you provide an example for this?
      I have created a dynamic form and it can be multiple rows and the data will be pass via ajax call.
      My data is looks like
      Ex: {name:["A", "B"], age:["23","21"]}

  • @rachnasingh8976
    @rachnasingh8976 4 года назад

    cors error
    how to solve it
    plaese

    • @Javatechie
      @Javatechie  4 года назад

      Please add below snippet of code in your spring boot config or main class
      @Bean
      public WebMvcConfigurer corsConfigurer() {
      return new WebMvcConfigurerAdapter() {
      @Override
      public void addCorsMappings(CorsRegistry registry) {
      registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE").allowedOrigins("*")
      .allowedHeaders("*");
      }
      };
      }

    • @rachnasingh8976
      @rachnasingh8976 4 года назад

      ok sir

    • @rachnasingh8976
      @rachnasingh8976 4 года назад

      deprecation warning

    • @Javatechie
      @Javatechie  4 года назад

      Is your cors issue resolved ?

    • @rachnasingh8976
      @rachnasingh8976 4 года назад

      no