This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
what i am required to do is, according to some condition instantiate 3 different bean in the servlet. The buisness logic is in the bean, and then i also need to know how to pass the data in the bean to the JSP's. Thanks
Sharmila, Here is a sample code. Assume "SampleBean" is your bean's name. 1.In your servlet code "import SampleBean;" 2.Make an instance SampleBean sb = new SampleBean(); or any other bean's constructor you would like to call 3. Call the needed methods on this bean instance sb.setData("somearg"); 4. pass this bean to jsp HttpSession httpSession = request.getSession(false); httpSession.setAttribute("myBean",mb); getServletContext().getRequestDispatcher(response.encodeURL("/login/welcome.jsp"));
regds maha anna
[This message has been edited by maha anna (edited March 30, 2001).]