Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Spring Boot with Ajax using jquery doesn't seem to be working

 
Ranch Hand
Posts: 49
Eclipse IDE MySQL Database Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing a simple signup form where I am using Ajax call to implement this functionality.
I am using jquery for the ajax call.
I am trying to fetch the data from form using ajax and insert that form data in database and if the email entered by the user is distinct or unique then the data is inserted otherwise result failed is shown.
This code here doesn't seem to work. The ajax call is completing successfully, but I am getting error saying all the fields that I have in the model User are empty which is also the reason why this data is not being inserted in the database.

Here is the model class :-


I have removed the validation annotations from it thinking that those constraints were somehow responsible for this behaviour

Here is my controller class :-


This is my html form that I am working with :-


Please don't mind the alignments. Here is the js file which is executing the ajax call

If you can please help me with this.
Thanks in advance
 
Ranch Hand
Posts: 570
3
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the completed errors
 
Sheriff
Posts: 21971
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you try this in Chrome, open its DevTools (F12) and check what the actual request to the server is?
 
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic