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 |
What is servlet and its life cycle?
how a user session can be tracked in servlets?
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 are its drawbacks of cgi?
What are advantages of servlets over cgi?
What is life cycle of Servlet?
What is the difference between the servlets and cgi programs?
How long do servlets last?
What are the different methods involved in generic servlet?
What's the architecture of a servlet package?
What is the main purpose of java servlets?
Why filter is used in servlet?