Help me in disabling checked checkboxes

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"     
    pageEncoding="ISO-8859-1"%>      
<html lang="en">      
<head>      
<title>checkbox disabling</title>      
<script type="text/javascript">      
function disableHandler (form, inputName) {      
var inputs = form.elements[inputName];      
for (var i = 0; i < inputs.length; i++) {      
var input = inputs[i];      
input.onclick = function (evt) {      
if (this.checked) {      
disableInputs(this, inputs);      
}      
else {      
enableInputs(this, inputs);      
}      
return true;      
};      
}      
}      
     
function disableInputs (input, inputs) {      
    for (var i = 0; i < inputs.length; i++) {      
    var currentInput = inputs[i];      
    if (currentInput = input) {      
    currentInput.disabled = true;      
    }      
    }      
    }      
     
     
</script>      
</head>      
<body>      
<form name="aForm" action="">      
<p>      
<label>      
Blue      
<input type="checkbox" name=details[] value="blue">      
</label>      
<label>      
Green      
<input type="checkbox" name=details[] value="green">      
</label>      
<label>      
Red      
<input type="checkbox" name=details[] value="red">      
</label>      
</p>      
</form>      
<script type="text/javascript">      
disableHandler(document.forms.aForm, 'details[]');      
</script>      
</body>      
</html>    

Tha above code is running…but i want some modification in this code…such that…

when i select some checkboxes and submit this form…and when we again goes to this page via request/responce from web server, it should display previoue checked checkboxs as disabled.and remaining checkboxes as enabled.

I have stuck this problem from last 2 days…so please, help me out.

Thank you for your help in advance

A: Why are you sending both a specific checkbox and the array of all checkboxes to disableInputs, then looping through the array to find the specific checkbox that you sent? This is akin to having an apple in your hand, then looking through a bag of apples to find the one that you have in your hand.

B: JavaScript is not the solution to this, JavaScript has no state permanence, therefore when you reload the page, JavaScript has no access to what happened before and cannot help you. You’ll need to look into using JSP, JSTL, or Scriplets to access the request and/or session objects, which is where the state data you’re looking for resides.

I wouldn’t do it using javascript either because it won’t work in javascript disabled browsers.

but if you must use javascript, then you can get it to store the state of your checkboxes in cookies. But this also won’t work in cookie disabled browsers.

I would store the state of the checkboxes in session variables on the server.

JSF and JSP can store session variables.

can anybody , suggest or give me how to implement this using jsp/servlet/jstl.

waiting for your reply…Thank you for your help in advance:)