| Author |
Struts passing data across tiles
|
chris hart
Greenhorn
Joined: Oct 09, 2003
Posts: 9
|
|
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.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56204
|
|
Definitely more appropriate for the Struts forum. Moving this there. bear
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Junilu Lacar
Bartender
Joined: Feb 26, 2001
Posts: 4118
|
|
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> body JSP: <html:text> .... footer JSP: <html:submit>
|
Junilu - [How to Ask Questions] [How to Answer Questions] [MiH]
|
 |
chris hart
Greenhorn
Joined: Oct 09, 2003
Posts: 9
|
|
|
Thanks you very much Junilu. I guess I was tring to keep the layout completly generic (with out an knowledge of fields). However using your method the values do get submitted. Thanks again.
|
 |
Junilu Lacar
Bartender
Joined: Feb 26, 2001
Posts: 4118
|
|
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>
|
 |
 |
|
|
subject: Struts passing data across tiles
|
|
|