Build AEM form component to store data in database | Community
Skip to main content
rsl_lucky
Level 4
Jan 4, 2022 10:00 AM UTC
Solved

Build AEM form component to store data in database

Hi All,

Have a requirement to build a Form with input params in Component html. End-user fills Form details and submitted data to be stored in external database Ex:MySQL. Data Source configuration of DB details in AEM have been taken care. Can you provide your insights on below on how to fulfill this. 

* How to pass Form input params from html to backend logic?

* Best way for back-end logic implementation ?

Any insights would help. Thanks in Advance.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
manikanthar1295
manikanthar1295Accepted solution
Level 5
Jan 4, 2022 1:18 PM UTC

Hi @rsl_lucky 

 

You can use request.getparam("paramName"); in your servlet get method using httpSlingRequest object.

 

I think this might help you.

 

Regards

Manikantha R

3 replies

Level 3
Jan 4, 2022 1:02 PM UTC

You can design form via <form> in html . You can call servlet via Ajax once submit button clicked. Prepare Java code for database connection and related logic.

Translate
rsl_lucky
rsl_luckyAuthor
Level 4
Jan 4, 2022 1:07 PM UTC

In this approach, how can we pass Form input fields to backend logic for processing.

Any sample code across it would help.

Translate
manikanthar1295
manikanthar1295Accepted solution
Level 5
Jan 4, 2022 1:18 PM UTC

Hi @rsl_lucky 

 

You can use request.getparam("paramName"); in your servlet get method using httpSlingRequest object.

 

I think this might help you.

 

Regards

Manikantha R

Translate