• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Submitted Form values are repeated across

 
Ranch Hand
Posts: 45
Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

Form values submitted on one of my page are displayed even after navigate back to that page from other pages.I guess the problem is as I have defined managed bean associated with session scope and that's why values are retained in form bean object.Is there anyway to clear the already submitted values?
 
Ranch Hand
Posts: 479
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

To my understanding when a Form Bean is instantiated the Struts framework calls the reset() method. That would take care of setting the form elements to default values. Now a request scope would mean the the form beans are created per request and the reset methods should take care of the rest.

A session scope would make things different and am not sure of the exact life-cycle. Worst case you might have to reset the form bean manually? Are you over-riding the reset()?

Cheers,
Raj.
 
Smitesh Shinde
Ranch Hand
Posts: 45
Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raj,
I am extremely sorry for misguiding I should have called in managed bean.As I am migrating from struts to JSF I wrongly called it form bean.
 
Rajkamal Pillai
Ranch Hand
Posts: 479
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I answered seeing the mention of the form bean. Am certainly not the best guy to suggest anything on JSF. Sorry! Hope somebody else helps you out here...

Cheers,
Raj.
 
Hug your destiny! And hug this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic