Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can we use servlets in JavaScript?

Answer Posted / balu

we cant use servlets in javascript but we can call a
servlet by retrieving the form and setting the action as
the url.
ex:if our html has a from named 'XXX'

var formName = document.getElementById('XXX');
var url = contextPath + '/desiredServlet';
formName.action = url;
formName.submit();

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different ways we can maintain state between requests?

1061


How to get ip address in jsp login page and how to validate like 127.1.0.1 all should not be greater than 255

3350


What is a java servlet?

1012


What is a deployment descriptor?

1064


What do you mean by httpservlet and how it is different from the genericservlet?

1003


How does java thread pool work?

1028


What are the steps that are required to handle the multi-threading?

1057


What is the difference between the include() and forward() methods?

1037


How do you communicate in between Applets and Servlets?

1028


What is a web container and what is its responsibility?

930


How do you configure a centralized error handler in servlets?

1046


Explain mvc pattern.

972


What is SingleThreadModel interface?

1096


How can you create a session in servlet?

1101


Which interface must be implemented by all servlets?

1300