This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hello all, How to get the bean instance of JSP in servlet? I have a x.jsp, there are 3 input fields. I have a xbean.java for the above input form of the x.jsp. jsp use bean tag is used in this x.jsp. set property * is used to populate all the fields that the user has entered in this input form in the bean(which the jsp engine does). How to get this xbean instance in the servlet for processing? so that i can call get methods of this xbean to get the user input and process. Thanks in advance
You can't wake a person who is <b><i>pretending</i></b> to be asleep.<br />Like what <b>"it"</b> does not like - <i> Gurdjieff </i>
The scope of the bean u have declared in the jsp decides how u can fetch it in the servlet. if the scope is request and the id of bean is "xBean" u can retrive it using (TypeCast)request.getAttribute("xBean"); or if the scope of bean is session in jsp the same can be retrived from (TypeCast)session.getAttribute("xBean"); Devesh