How to pass a JavaBean from servlet to JSP?
843833Aug 5 2001 — edited Aug 22 2002Hi there,
I am working on a project that needs to handle quite a few client requests and I want to use the Front Controller pattern that is described in the J2EE pattern page.
The steps described in the front controller pattern is that:
1. A servlet (controller) process the client request.
2. It calls the appropriate cammand object and the cammand object gets the data from the data source and returns a JavaBean that contains the required data.
3. The servlet dispatch to the appropriate View (jsp page)
4. The JSP page displays the data in the JavaBean to the user.
However, I don't know how to pass the JavaBean from the servlet to the JSP page when the servlet forwards the control to the JSP page. Should I make the JavaBean with a request scope or higher? If so, how to uses it in the JSP page? Just refer by the ID of the JavaBean.
If any one knows there is an example or tutorial on how to use this pattern, please let me know.
Thank you !
Regards
Edmund