Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning 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
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

ajax request not working with Spring boot

 
Ng Sharma
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm try hit url using ajax but it not working.

Javascript File



Controller



LeadCapture Class
 
Stephan van Hulst
Saloon Keeper
Posts: 11882
253
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ItDoesntWorkIsUseless
 
Campbell Ritchie
Marshal
Posts: 68904
275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I merged your stuff with the following thread. I hope that is okay by you.
 
Ng Sharma
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every time I try to send a post request, I get 500 error.Post request via postman works fine too, so there is no problems on the server side. What is the Mistake?

Controller

 
Stephan van Hulst
Saloon Keeper
Posts: 11882
253
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm thinking that you can't use HttpEntity<MultiValueMap<String, String>> to create a JSON request.

See if this recent topic helps you out: https://coderanch.com/t/730462/java/HTTP-POST-java-process-throwing
 
Tim Holloway
Saloon Keeper
Posts: 21963
149
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A "500" error is a server-side error. You should have a stack trace and we need to see it before we can offer much in the way of help.
 
Ng Sharma
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:A "500" error is a server-side error. You should have a stack trace and we need to see it before we can offer much in the way of help.


It's only throw 500 internal error
 
Paul Clapham
Marshal
Posts: 25436
65
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what you mean by "internal error".

If you use Ajax to submit something to the server, and it comes back with a 500 status code, then that means that an error occurred on the server. So if that's what happened to you, then you have to look on the server to find out what the error was. Or if it's not your server, then you need to contact the people who manage the server and ask them to work with you to find the problem.
 
Create symphonies in seed and soil. For this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic