I want to update the value of a session attribute when a button is clicked on a page without using a form and redirecting to another page.
I've looked at JSTL and scriptlets but because these occur on the server end, they already happen before the button is clicked.
I have looked into AJAX but I am not entirely sure how the whole process works.
Any suggestions on how to accomplish this?
Something that can be incorporated into:
function myFunction()
{
//setAttribute("session_variable_name", "newvalue")
}
<button onclick="myFunction()">Change Variable</button>