Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling the managed bean from javascript using AJAX

 
Devesh Kashyap
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i code in javascript page for requesting the managed bean on server by using AJAX

<script type="text/javascript">
var req;
function f1()
{

if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHttp");
}
else {
req = new XMLHttpRequest();
}
req.open("GET","http://localhost:60/LibraryManagement/librarypack/CreateManagedBean.deleteMembershipCategory()",true);
req.onreadystatechange=f3;
req.send(null);
}

function f3(){
if (req.readyState == 4) {
parseMessages(req.responseXML);
}
}

This code is not works. So check the errors and write the errorfree code
 
Henry Wong
author
Marshal
Pie
Posts: 21498
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Devesh Kashyap wrote:How can i code in javascript page for requesting the managed bean on server by using AJAX



This code is not works. So check the errors and write the errorfree code


First of all, read this ... https://www.coderanch.com/how-to/java/NotACodeMill


And second, this is the jobs discussions forum -- and not the javascript forum. Please be careful when posting. In the meantime, I will move this topic to the HTML and JavaScript forum for you.

Henry
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Devesh,
Welcome to CodeRanch!

This can't be part of a URL:
CreateManagedBean.deleteMembershipCategory()

It looks like the method name in Java. What URL do you it configured to map to.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic