Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to call a servlet from a Java Script function

 
indu yeturu
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, can you please tell me how to call a servlet from JavaScript function..
thanks
indu
[ August 31, 2008: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
indu yeturu
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JS function can able to call doGet() of Servlet, but not calling doPost() . I added <form method="post">.
Thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic