Getparameter servlet null




















I have attached relevant snippets of the html and js code and the servlet code to test if the parameters are being received. It must be a problem between ajax and servlet.

If you look at the method attribute, its not being taken from user input or any html element it is hard coded but even that returns null in the servlet. Rob Spoor. I like You're sending the data as JSON but are attempting to read it as if you've sent them as a form. Thank you so much.

So that would mean I have to change my html to include a form rather than just input text for the username and password fields. The javascript does the jsonstringify to the data so why would I need to covert the request data into json if it is already in that format?

Many thanks. Are you sure the request in getting posted to your servlet. Secondly, have you changed the attributes to double quotes.. For information : it is not must Coming to the problem. Hi, can you try printing the parameter names from the request? Hi Srini, request. Marimuthu Madasamy. In case 'request' has no parameters, the method returns an empty Enumeration.

Eitehr double or single quotes can be used, though it more customary to use double quotes. Hi Marimuthu, The getParameterNames returned empty enumerator java. Thanks Jack. Hi, Please help me out in finding why my doPost is not working Sorry to bother you all, its a bit urgent..

Please post your Servlet Code. Collectives on Stack Overflow. Learn more. Asked 4 years, 10 months ago. Active 4 years, 10 months ago. Viewed 3k times. Improve this question. Community Bot 1 1 1 silver badge. Veshraj Joshi Veshraj Joshi 3, 2 2 gold badges 23 23 silver badges 39 39 bronze badges. Are you uploading files too? Add a comment. Active Oldest Votes. Improve this answer. Robby Cornelissen Robby Cornelissen



0コメント

  • 1000 / 1000