I'm trying to use html onclick in java servlets like this;
ShoppingCart cart = new ShoppingCart();
out.println(" <h1><button type=\"button\" onclick=\"cart.addBook(b.getIsbn())\">add</button> </h1>");
addBook is a method in ShoppingCart class, and I'm calling it when the button is clicked, but it's not getting called. Please help.