How can you maintain servlet chaining?



How can you maintain servlet chaining?..

Answer / bikash khuntia

you can maintain servlet chaining by using:

1. RequestDispatcher
2. include

Step 1: Set the request

request.setAttribute(key,value);

Step 2: Implimanting of RequestDispatcher

RequestDispatcher rsd = getServletContext().
getRequestDispatcher("Servletname");

Step 3: Forward or include the request and response by

rsd.forward(request,response);

rsd.include(request,response);

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More Servlets Interview Questions

What is servlet and its life cycle?

0 Answers  


how a user session can be tracked in servlets?

1 Answers  


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!

0 Answers  


What are its drawbacks of cgi?

0 Answers  


What are advantages of servlets over cgi?

0 Answers  






What is life cycle of Servlet?

0 Answers  


What is the difference between the servlets and cgi programs?

0 Answers  


How long do servlets last?

1 Answers  


What are the different methods involved in generic servlet?

0 Answers  


What's the architecture of a servlet package?

0 Answers  


What is the main purpose of java servlets?

0 Answers  


Why filter is used in servlet?

0 Answers  


Categories