Quando stampi il tuo select box, puoi passare il parametro onChange="sendInfo(this.value);" funzione come di seguito:
$('<div>
<!--adding onchange and passing selected value to it-->
<select class="selected-meal-type" onchange ="sendInfo(this.value);">
<option value="TYPE A">TYPE A</option>
<option value="TYPE B">TYPE B</option>
<option value="TYPE C">TYPE C</option>
</select> <span id="amit" /></span>
</div>
<br>').appendTo('#container');
Ora nel tuo sendInfo funzione fare come di seguito:
function sendInfo(str)//str will have value selected from dropdown list
{
//attaching this value in url
var url="process.jsp?val="+str;
if(window.XMLHttpRequest)
{
request=new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
request=new ActiveXObject("Microsoft.XMLHTTP");
}
request.onreadystatechange= function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("amit").innerHTML = this.responseText;
}
};
request.open("GET",url,true);
request.send();
}
Inoltre, non dimenticare di aggiungere div con ID amit .Ora, se selezioni Type B quindi, val avrà valore TypeB , usalo nel tuo select query e inviato il risultato al tuo jsp pagina.