• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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...
 
That's a very big dog. I think I want to go home now and hug this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic