Why you want to remove an attribute. In fact, when the session will be invalidated all would do garbage collected anyway, since there would be no reference. You might want to use a low timeout in this case.
In case you want to invalidate session right away. You can always employ a JavaScript function to post the request to your server, on a click of your "Ok" button. This might not be a very reliable thing to do, but wouldn't hurt as a facility. Below is an example code,
JavaScript Function
function show_confirm()
{
var r=confirm("Are you sure you want to abort the session?");
if (r==true) {
// set an appropriate form action and
document.form.submit();
}
}
HTML
<input type="button" onclick="show_confirm()" value="Show confirm box" />
[Edited after your comments]
So, you want to bind the button to your bean method, you have to do something custom, using CSS and JavaScript. Look at this tutorial, it will provide you some insights on how you will create a custom popup. Since its just a normal <div>
, you would be doing it just like any other button, no rocket science here, just put your button code inside that <div>
.