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.
There are no restrictions on the number of beans a JSP can use: <jsp:useBean id="b1" class="com.mycompany.Class1"/> <jsp:useBean id="b2" class="com.mycompany.Class2"/> ... <jsp:useBean id="bn" class="com.mycompany.Classn"/> ------------------ Phil Hanna Author of : JSP: The Complete Reference Instant Java Servlets
Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
Joined: Jun 19, 2000
yes, I know that, but my problem is we using the Struts/jboss/tomcat in my project. We use Form beans which handle the Form in JSP and action beans do the dopost/doget kind of thing. It looks like the Struts(ejb container?) will get fields out from Jsp page(which contains a form) and call the appropriate Action bean as well as set the Form bean. In this case, since I only have a field(like textarea) associated with the field of one bean instance(the other instances are stored and active when user select them one by one from a radio button), How can Struts know which bean instance to be updated?
You have Form Beans and Action Beans defined as Phil has suggested in your JSP
If that is the case, your ActionBean would make an invocation to your EJB Beans in the Strut.The Strut would give the result back to your Action Bean.The instances of the Action Bean would be handled by the JSP Engine, so we need not worry about it. Let me know your views on this. Regards,