I am working on a project on online e-commerce website.My requirement is that when a user clicks on "Add to cart" option some queries will be sent to the database and no redirection will take place.how to do this using jsp.(I don't know javascript).

You can do it with ajax, and you will also need to learn javascript.
It is easier to use the jQuery library to make an ajax call.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.