We can’t use RequestDispatcher to invoke servlet from another application because it’s specific for the application. If we have to forward the request to a resource in another application, we can use the ServletResponse sendRedirect() method and provide the complete URL of another servlet. This sends the response to the client with the response code as 302 to forward the request to another URL. If we have to send some data also, we can use cookies that will be part of the servlet response and sent in the request to another servlet.
Posted Date:- 2021-08-19 06:16:08
What do you know about the ServletConfig object?
What advantages does a servlet offer over CGI?
What do you mean by a web application?
What is the difference between the POST and GET methods?
What do you mean by MIME Type?
7. What do you mean by Session Tracking and also explain its techniques?
Who is liable for writing a constructor?
Name the various types of session tracking?
Why do we have servlet listeners?
Why HttpServlet class is declared abstract?
How can we invoke another servlet in a different application?
How do we call one servlet from another servlet?
What is servlet attributes and their scope?
What is the inter-servlet communication?
Is it good idea to create servlet constructor?
Do we need to override service() method?
What is the use of servlet wrapper classes?
How can we create deadlock situation in servlet?
What is difference between PrintWriter and ServletOutputStream?
How to get country name in Servlets?
How to create a cookie using servlet?
How to read form data in servlet?
When init() method of servlet gets called?
What are the major tasks of servlets?
What do you mean by Default initialization in Java Servlet?
What is the difference between Servlets and applets?
Can we refresh servlet in client and server side automatically?
What is the difference between Server and Container?
Why session tracking is needed?
What are the supporting protocol by HttpServlet ?
What are the features added in Servlet 2.5?
How can we refresh automatically when new data has entered the database?
What is a web container and what is its responsibility?
What are the life cycle methods of the Servlet?
What is the difference between the Http Servlet and Generic Servlet?
How is a Servlet implemented in code?
What are the advantages of Servlet over CGI?
When do you think Servlet is unloaded?
What do you mean by Servlet context?