Reference to RFC 2109, you just need to use the Set-Cookie header in your HTTP response, and set the cookie you want to be cleared to a blank value.Such as
Set-Cookie: ssid=
Update:
I am not familiar with JSP, so I use PHP and Javascript for example, assume that you don't have HttpOnly property in your cookies.
I use this PHP code to set cookie, you can upload this PHP script to your web server, www.yourserver.com/setcookie.php
<?php
setcookie('name', 'li');
?>
And I use this HTML file to clear your cookies, once again, upload this HTML file to your web server, www.yourserver.com/clearcookie.html
<script>
function deleteAllCookies() {
var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i];
var eqPos = cookie.indexOf("=");
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
}
}
deleteAllCookies();
</script>