• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

2 JSP pages using the same form bean

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to create 2 jsp pages that use the same form-bean. The second page creates it's own version of the bean and the data from the first page is lost. The following is from the jsp pages and config.xml file. Can anyone show me what I am doing wrong or tell me how to make this work?
Thank you for any suggestions.
Gerald
*****Config.xml ***************
<action path="/Provider"
type="com.ProviderAction"
name="reportSelectionForm"
scope="session"
validate="true"
input="/provider.jsp"
>
<forward name="success" path="/Offices.jsp"/>
</action>

<action path="/Offices"
type="com.OfficesAction"
name="reportSelectionForm"
scope="session"
validate="true"
input="/offices.jsp"
>
<forward name="success" path="/Success.html"/>
</action>
**************************************
*** first jsp *******************
<html:form action="Provider.do"
name="reportSelectionForm"
type="com.ReportSelectionForm"
scope="session"
>
*** second jsp ********************
<html:form action="Offices.do"
name="reportSelectionForm"
type="com.ReportSelectionForm"
scope="session">
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your form overriding the reset() method? If it is, try it without overriding reset().
 
Gerald Nichols
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought of that - I removed all the code from the reset method so it did not clear any fields. It still creates a new bean and not reusing the first bean.
Gerald
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gerald Nichols:
I thought of that - I removed all the code from the reset method so it did not clear any fields. It still creates a new bean and not reusing the first bean.
Gerald


Try to modify the visibility for scope:
<action path="/form1"
type="test1.Action1"
input="pag1.jsp"
scope="session"
name="form1">
Hope that helps.
 
You'll never get away with this you overconfident blob! The most you will ever get is this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic