Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

submit problem with multiple forms and formbean

 
Busty Sinclair
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a page with two forms,
The problem is when I press the bottom forms submit button, the top form is submitted but to the action in the bottom form.
I have a formbean associated with the page and I think this is the cause, no matter what form I submit, it expects to submit an object of the type associated with the page, i.e. the form bean defined in struts.config.
Anyone any ideas?
thanks in advance
 
R K Singh
Ranch Hand
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try after dis-associating formbean with jsp page
 
Junilu Lacar
Bartender
Posts: 7557
52
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Form beans are associated with an Action via the name attribute in the action mapping in struts config.
My guess is that you have a problem in the html:form tag or in the struts-config. In the html:form tag make sure that you have the correct action specified. Cross-check that against the struts-config action mapping and make sure the name attribute is correct. Then go to the form definition and make sure that the correct form class is specified.
 
Busty Sinclair
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks you two,
I had quadruple checked the struts config info against the form info but no luck.
My mgr came to me this morning with a new design for the page layout again anyway and now the two forms are on diff pages so no prob!
B.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic