I want to store id in httpsession when a button is clicked so that I can use it in another servlet.
HttpSession session = request.getSession();
<button>
<a href = "\"http://localhost:8080/WhatASap/createConversation\""
+ "style=\"text-decoration:none\""
+ "onclick=\"session.setAttribute(\"ID\","+ ID + ")\">
Chat
</a>
</button>
When I am clicking the button ID is not getting set in httpsession.