0

I developed an application in angular which contain forms. And sent the data in the form of json using http post, and want to read those values in servlets and display. Can anyone please suggest me the solution.

onSubmit() {
let enteredDetails = {
  ename: this.name,
  email: this.email,
  phoneNo: this.phoneNo
}
let contactDetails = JSON.stringify(enteredDetails);
this.http.post('http://localhost:8080/registerationapp/ins', contactDetails);

The json object that is created is in this form. {"ename":"vardhan","email":"abcd@gmail.com","phoneNo":"9876543210"}

  • Can you explain more precisely what do you mean by "read those values in servlets and display"? – Nicola Ambrosetti Jul 11 '19 at 06:49
  • i want to get "entered values" from angular and wanted store these values in database by using servlets program.And i want code of servlets to get these values. – vardhan morla Jul 11 '19 at 10:36
  • Why do you insist that it should be a "servlet"? Do you already have a java application with other servlets? You seem to ask several questions: how to make a java servlet application, how to process JSON in java, how to connect to a database, how to map an object to a database table, etc. Please try to be specific in which part you are focusing on in the question. Consider asking several questions for the different parts. Look at https://stackoverflow.com/help/how-to-ask for suggestions in how to ask a good question. – Nicola Ambrosetti Jul 11 '19 at 11:00
  • You can check [this](https://stackoverflow.com/questions/2591098/how-to-parse-json-in-java) post for parsing `json` data . – Swati Jul 11 '19 at 13:08
  • I want only code to get these angular form values into servlets. – vardhan morla Jul 11 '19 at 16:57

0 Answers0