aspose file tools*
The moose likes Struts and the fly likes Nested Forms data are not getting in Action(Java) Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Nested Forms data are not getting in Action(Java) Class" Watch "Nested Forms data are not getting in Action(Java) Class" New topic
Author

Nested Forms data are not getting in Action(Java) Class

sohaib yasir
Ranch Hand

Joined: Mar 10, 2014
Posts: 49

Hi All,
I have a requirement where Container JSP includes multiple JSPs with there own <form> inside the Container's JSP <form> tag. Let me explain how my code structure looks like in code snippet. My scenario is something like that i could save included
JSP form as a draft during submit their "Save as Draft" button and when submit my "Check OUT" button then all included forms data could be available to my action class. Now problem is that when i submit my Container's JSP form then data in first immediate available form is available to my action (in my case it is a1.action) and other forms have null value i.e; a2.action , a3.action etc. have null values. Solution required to resolve this problem now .
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10033
    
163

Nested forms are not allowed in HTML. You can have multiple forms on a page but you can't have those forms nested within each other.

[My Blog] [JavaRanch Journal]
sohaib yasir
Ranch Hand

Joined: Mar 10, 2014
Posts: 49

Before someone ask me why i need nested forms i thought i should mentioned that earlier. I have multiple collapsible panel in my page and allowing user to save individual panel or submit complete page. To include JSPs in my Container jsp, i have used struts <s:include> tag. Now i think its pretty much clear to answer my query. Thanks.
sohaib yasir
Ranch Hand

Joined: Mar 10, 2014
Posts: 49

Jaikiran Pai wrote:Nested forms are not allowed in HTML.


Ok Pai, i agreed as per your comments. Now please guide me how could i achieve my requirement of submitting complete page and individual panels ???
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Nested Forms data are not getting in Action(Java) Class