View Single Post
  #1 (permalink)  
Old 05-20-2008, 02:03 AM
hussainzim hussainzim is offline
Member
 
Join Date: May 2008
Posts: 14
hussainzim is on a distinguished road
how to send values from servlet..
hi..im using ajax to send some data according to the name selected from the combo box to the servlet..i hav managed to get the necessary values from the database to the servlet as a LIST but im clueless on how to send those values to jsp and print in the page...if i can hav a smaple code it would be very helpful..thank u in advance...

Hussain

Ajax Code..
--------------------------------------------------
var selectedAuthor = author.options[author.selectedIndex].value
alert(selectedAuthor);
var url = "/HRS2/AjaxServlet?author=" + escape(author.value);

if (window.XMLHttpRequest) {
req = new XMLHttpRequest( );
}
else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
req.open("Get",url,true);
req.onreadystatechange = callbackAuthor;
req.send(null);


}

function callbackAuthor() {

if (req.readyState==4) {

if (req.status == 200) {

authorCheck( );

}
else
{

}
}
}

function authorCheck( ) {
//i think the printing comes here...
}
Reply With Quote
Sponsored Links