• 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:

How to preserve bean values across pages?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am bit new to struts however I learnt few concepts.

Now i am trying to implement the following scenario

1. Initial JSP page should display 2 text fields (say fname, lname) and a (next)button

2. On clicking the next button in step1 i should display another JSP page with 2 text fields (say address, phone) and one (next)button

3. On clicking the next button in step2 I should display the inputs given in page 1 and 2 (steps1&2)

I am through steps 1 and 2 however I am facing trouble with step 3. whenever i click on the next button the input i gave was lost.

I am using single formbean and action class for this requirement

please guide me to fulfill this requirement

Also, let me know if you need more details.

Thanks,
Thani
 
Ranch Hand
Posts: 265
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without seeing the classes and your action mappings, it's hard to identify what the real cause of the problem is.

One place to check is the scope of your action mapping for the actions. If you have it set to request, for example, and are not including the previously entered data in your forms, you may lose it.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Stevi put it, check your action mapping scope definition... I believe we need to set the scope as session (unless you are planning to set the previously entered data manually in both the Action class and JSP)..

do post your code snippet for action mapping so we can better assist...
 
Thanigaivel Soundararajan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Stevi and Bhasker.

As you both replied I replaced the scope from "request" to "session" and the application works as desired.

Thanks for your help...
 
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic