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 different ways we can maintain state between requests?
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
What is a java servlet?
What is a deployment descriptor?
What do you mean by httpservlet and how it is different from the genericservlet?
How does java thread pool work?
What are the steps that are required to handle the multi-threading?
What is the difference between the include() and forward() methods?
How do you communicate in between Applets and Servlets?
What is a web container and what is its responsibility?
How do you configure a centralized error handler in servlets?
Explain mvc pattern.
What is SingleThreadModel interface?
How can you create a session in servlet?
Which interface must be implemented by all servlets?