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.
I'm not sure, nor can I even imagine, what you are trying to do here -- why would Tiles care about the FormBean? Tiles is really just some sort of CompositeView Dispatcher .... so, um ... yeah. Technically speaking though, the FormBean will be bound in the appropriate context, which means that anybody in the pipeline can access it (after it gets to the action Servlet of course).
I want multiple instances of a formBeanA to be held in a collection in formBeanB. I want a jsp page That starts with FormB on top and then inserts multiple tiles underneath each tile holding a form that is of type formbeanA. I understand <tiles:insert .... <put ... </tiles:insert> and then using <tiles:get ....>
My question is in the inserted.jsp where you have the get. How would you associate the formbean that is passed in to the <html:form action=.... tag?
Everytime you have the tags <html:form action="..."> struts creates an instance of the form bean associated to that action in the struts config (or so it appears to me). I don't want this new/empty formbean... I want the one I passed in.
You can define a form bean as having session scope instead of request scope. In this case, the bean is always there. This is tricky to handle, though; you will obviously take over responsibility for initializing the bean data. The books I have read on Struts (Cavaness, Husted) describe how to do this and list the caveats. You may want to review their treatment.
Kevin Judd, SCJP
Joined: Nov 16, 2004