Vasa
Vasa

Reputation: 45

Java - Connecting javascript to servlet in eclipse dynamic web project

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

Answers (1)

Mohsin AR
Mohsin AR

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

Related Questions