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.
Hi all, I am using struts with tiles. I have a JSP page and a layout which consists of a header, body and footer. The body is where the user enters some info. The footer contains the submit button. Clicking the submit button is only submitting the footer data and not the body data. How do I submit data from a specified tile or multiple tiles inorder for my FormAction class to see it. Thanks for any help.
Where is your html:form tag/endtag located? It would have to be in the layout.jsp that has all your tiles:insert tags. That way, your submit button would be in the same form as the fields it is submitting when the tiles are assembled. layout.JSP: <tiles:insert header> <html:form> <tiles:insert body> <tiles:insert footer> </html:form>
You can make the layout more generic. We do this in our layout: <%@page import="org.apache.struts.action.ActionMapping" %> <% ActionMapping actionMapping = (ActionMapping) request.getAttribute( Action.MAPPING_KEY); %> <html:form action="<%= actionMapping.getPath() %>" > ... </html:form>