Reputation: 45
I am new to building dynamic web project. I have javascript as my front end. My query is how do i retrieve something from the database by clicking a button in the front end? How is javascript connected to servlet class to trigger an event in the backend?
Upvotes: 1
Views: 698
Reputation: 3108
If you are using servlet then you can use jsp (front end) as well to connect to your servlet, in jsp you need to write javascript code in <head>
tag or by creating separate .js
file then with help of button
onclick function you will connect to your servlet by posting form
Please read this
Upvotes: 1