Namratha
Namratha

Reputation: 16790

Populating text fields using AJAX from JSP scriptlet with data obtained from Oracle 10g database

How do you populate text fields using AJAX from JSP scriptlet with data obtained from Oracle 10g database? How do you get a handle on those input elements of type text from a jsp? Using javascript? but how do you use the values in the scriptlet?

Thanks

Upvotes: 0

Views: 1987

Answers (2)

Mike Croteau
Mike Croteau

Reputation: 1132

If I am understanding your question right : Why not use a javascript templating engine and just populate and render the template with the json response? If you haven't used templates like this, I would probably investigate. There are quite a few options out there, Mustache is a decent one : http://mustache.github.com/. http://coenraets.org/blog/2011/12/tutorial-html-templates-with-mustache-js/

Upvotes: 1

maestr0
maestr0

Reputation: 5608

Not sure if I understand what you mean. You have JSP page that reads data from DB and some other page with text inputs. You want to populate these inputs with data from JSP using AJAX call, right ? So just write javascript that will hit JSP page and get a response in JSON format with data from DB and then populate the input fields.

Upvotes: 1

Related Questions