Can we use servlets in JavaScript?
Answers were Sorted based on User's Feedback
Answer / 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 |
Difference between get and post in java servlets?
What is generic servlet class?
explain the advantages of servlet life cycle?
How can the session in servlet be destroyed?
Which is better approach among four(HttpSession,cookie,URL Rewriting, Hidden Fields) Session Tracking technic's ? Why ?
What is servlet name in web xml?
What are all the advantages of servlet over cgi?
Why do you use session tracking in httpservlet?
How do we share data using 'getservletcontext ()?
what are the CGI Programs?
Explain the war file?
How to rectify errors in java servlet while compilation?