• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Form not posting data

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am new to creating web applications using Spring and having issues posting my data for verification. I have a simple login form using AngularJS. I am trying to post this data for verification to Spring. But my URL doesn't go to my String controller.

This is my angularjs controller code from where I am trying to call my Spring Controller:



My String Controller:



My web.xml:



There is no error on server but the data is not getting validated and the form gets refreshed. Please help

Update:

I tried checking the data through postmaster. My spring part works fine because it shows correct response for the sample JSON data I entered. So, the problem is with angularjs controller. I tried debugging this using firebug. The angularjs controller loads but the login method is not called. Kindly suggest.
 
Saloon Keeper
Posts: 15484
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you used your browser's developer tools to check out what requests are being sent, to where, and what the response is?
 
kuhu vora
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I used firebug to see the errors. There were no errors there. Also, I placed a alert in the angularjs controller which is being called. I also have a info statement in the Spring controller but this statement is not called. Can you please specify what else can I use to check? Sorry for this basic question
 
kuhu vora
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I used firebug to see the errors. There were no errors there. Also, I placed a alert in the angularjs controller which is being called. I also have a info statement in the Spring controller but this statement is not called. I tried using postmaster too which I am not familiar with. The request status comes out as 200(OK) but I couldn't see any JSON. I included the screenshot here.
Capture.PNG
[Thumbnail for Capture.PNG]
 
kuhu vora
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Update:

I tried checking the data through postmaster. My spring part works fine because it shows correct response for the sample JSON data I entered. So, the problem is with angularjs controller. I tried debugging this using firebug. The angularjs controller loads but the login method is not called. Kindly suggest.
 
kuhu vora
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought .fields was some angular thing to change form data to json. Anyways, I changed my request data in the controller:



Now, the request goes fine and gets code 200 but the response is bad. I can see the correct response in the browser tool but there is some problem parsing it.


 
Seriously Rick? Seriously? You might as well just read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic