I have a jsp say display.jsp which contains a check box. On click on checkbox i need to set a session variable by invoking another jsp.
With "self.document.location.href" the problem is when checkbxo is clicked, i can see setvarible.jsp loading. But i want the view to be on the same jsp(ie display.jsp) but just call setvariable.jsp in the background to set the value.
Can it be done?

function set() {
if (if(document.forms[0].apply.checked = true)
self.document.location.href = 'setvariable.jsp';

in setvariable.jsp i just need to set a session variable like session.setAttrib(..); and nothing else.

the problem with is "self.document.location.href" is that it loads another page.