How to pass JavaBeans data to JSP using Servlets?

Answers were Sorted based on User's Feedback



How to pass JavaBeans data to JSP using Servlets?..

Answer / pramod kumar

<jsp:useBean> tag can be used to avail the bean data in
case you are working with JSP's, or if you use a servlet
you can set the bean to the request object and forward it
to the JSP component and there in JSP retreive this object
and use getter methods and do something like this and it
works for sure.

Is This Answer Correct ?    3 Yes 0 No

How to pass JavaBeans data to JSP using Servlets?..

Answer / muralisankar

Using RequestDispatcher as follows,

RequestDispatcher rd =
getServletContext().getRequestDispatcher("test.jsp");
rd.forward(req,res);

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Servlets Interview Questions

Explain the difference between generic servlet and http servlet?

0 Answers  


What is servlet api used for conneting database?

0 Answers  


How do you invoke a servelt?

0 Answers  


How to find whether a parameter exists in the request object?

0 Answers  


What do you mean by request dispatcher in servlet? Also explain its methods.

0 Answers  






what is the different between a servlet and a cgi? Why do you go for servlet rather than cgi?

0 Answers  


i need connection pooling code.....from harpreet.your@gmail.com

1 Answers   IBM,


When the methods init() and Distroy() will be called?

2 Answers  


why business logic written using servlets not in jsp. Jsp used for presentation purpose. serlvet used for coding business logic and controller logic. Reason for using servlets in business logic.

5 Answers  


What is the difference between Get and Post Method?

12 Answers   T3 Softwares,


How does java thread pool work?

0 Answers  


What is servlet attributes and their scope?

0 Answers  


Categories