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
What are the disadvantages of storing session state in cookies?
How can you use a servlet to generate a plain text instead of html?
How do you invoke a servelt?
What are all the advantages of servlet over cgi?
What is a servlet engine?
What is string tokenizer?
What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?
What are the functions of Servlet container?
Whether thread can be used in servlets?
What is Client-Server Computing?
How can a servlet be used to generate plain text instead of html?
Write the code to get the server information in servlet.
What is servlet initializer?
What is the directory structure of web application?
What is difference between cookies and httpsession?