Question: How to send the parameter from jsp to servlet?

I have an application in which first the servlet sends a data list to jsp. User selects one option from the list and again jsp sends the selected option to servlet. Then servlet should process the request and send the data related to that selected option again to jsp for rendering.

How can I achieve this using java?

I am following MVC.

Answer: 
```
if(isset($_POST['ok']))
{
echo  "<script type='text/javascript'>";
echo "window.close();";
echo "</script>";
}

```
Do you define closeCurrentWindow() somewhere? You can't just make up functions and expect them to work :)

Try `window.close()`. Be aware of its limitations though:

> 
> The close method closes only windows opened by JavaScript using the open method. If you attempt to close any other window, a confirm message is displayed, asking the user to choose whether the window is to be closed or not.
> 
> 
> 

Source: <http://www.javascript-coder.com/window-popup/javascript-window-close.phtml>