• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts passing data across tiles

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Definitely more appropriate for the Struts forum. Moving this there.
bear
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
chris hart
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
reply
    Bookmark Topic Watch Topic
  • New Topic