aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes how to call a servlet from a Java Script function 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 "how to call a servlet from a Java Script function" Watch "how to call a servlet from a Java Script function" New topic
Author

how to call a servlet from a Java Script function

indu yeturu
Ranch Hand

Joined: Aug 27, 2008
Posts: 123
Hi, can you please tell me how to call a servlet from JavaScript function..
thanks
indu
[ August 31, 2008: Message edited by: Bear Bibeault ]

thanks,
indu
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

As a GET or a POST?

For the former, load the URL of the servlet using:


for a POST, cause a form with a method of "post" to be submitted.

Or use Ajax.
[ August 31, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
indu yeturu
Ranch Hand

Joined: Aug 27, 2008
Posts: 123
JS function can able to call doGet() of Servlet, but not calling doPost() . I added <form method="post">.
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to call a servlet from a Java Script function
 
Similar Threads
calling a servlet from javascript function??
Calling a Servlet (Urgent)
ejb
EJB calls to servlet
JOptionPane No X11 DISPLAY error