aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Calling the managed bean from javascript using AJAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Calling the managed bean from javascript using AJAX" Watch "Calling the managed bean from javascript using AJAX" New topic
Author

Calling the managed bean from javascript using AJAX

Devesh Kashyap
Greenhorn

Joined: Mar 16, 2013
Posts: 1
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
Sheriff

Joined: Sep 28, 2004
Posts: 18997
    
  40

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30957
    
158

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling the managed bean from javascript using AJAX