0

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...
}
2
Contributors
1
Reply
4
Views
9 Years
Discussion Span
Last Post by Thirusha
0

I would suggest using a bean, and then using the getter method on the jsp to get the information from the servlet.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.