Answer Posted / imtiyaz
There are three major reasons to use interservlet
communication:
Direct servlet manipulation
A servlet can gain access to the other currently loaded
servlets and perform some task on each. The servlet could,
for example, periodically ask every servlet to write its
state to disk to protect against server crashes.
Servlet reuse
One servlet can use another's abilities to perform a task.
Think back to the ChatServlet from the previous chapter. It
was written as a server for chat applets, but it could be
reused (unchanged) by another servlet that needed to
support an HTML-based chat interface.
Servlet collaboration
The most common, situation involves two or more servlets
sharing state information. For example, a set of servlets
managing an online store could share the store's product
inventory count. Session tracking is a special case of
servlet collaboration.
| Is This Answer Correct ? | 12 Yes | 1 No |
Post New Answer View All Answers
What is difference between GenericServlet and HttpServlet?
What is http servlet in java?
When jsessionid is created?
What is a web container and what is its responsibility?
How servlet is created?
What is the use of send redirect () method?
Hello, My project requirement is like I need to create a web page using MVC pattern. I hava a bean class, jsp page, servlet, service and dao. My jsp has two fields. One is dropdown list. The option values has to get populated from the database table. The other one is a text box and its value has to come from database table. As of now I have defined the fields in bean class, got the values from database using arraylists in dao class and I called this from service class. Can anyone please tell me the workflow of how the servlet will get this arraylist and populate the arraylist values as dropdown options in jsp page? Also I would like to know the role of bean class in MVC pattern? Thanks in advance!
What do you mean by session tracking?
What is a cookie What is the difference between session and cookie
What is api in servlet?
What is the need of servlet filters?
What is the process to implement doget and dopost methods?
What is the difference between using getSession(true) and getSession(false) methods?
How do you configure a centralized error handler in servlets?
Write a simple servlet program to print the contents of html.