How to pass a requrest object of one servlet as a request
object to another servlet?

Answer Posted / ravikiran(aptech mumbai)

using request.setAttribute("key",value) in the first servlet
and request.getAttribute("key") in the second servlet

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why the concept of single thread model interface is used?

545


Explain the differences between jsp and servlet.

535


What’s the use of the servlet wrapper classes??

630


What is the effective way to make sure all the servlets are accessible only when user has a valid session?

561


How can we refresh automatically when new data has entered the database?

613






Why doesn’t a servlet include main()? How does it work?

624


Describe some assignments that are executed by servlet container?

575


What is the use of httpservletrequestwrapper and httpservletresponsewrapper?

536


What is the use of httpservletresponsewrapper?

524


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!

1825


What is servlet container?

659


Define the lifecycle for executing a jsp page.

587


What is the difference between get and post methods?

595


If servlet receives multiple requests, how many objects will it create?

821


Why is a constructor needed in a servlet even if we use the init method?

598