Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Submitted Form values are repeated across

 
Smitesh Shinde
Ranch Hand
Posts: 45
Firefox Browser Java
  • Mark post as helpful
  • send pies
  • 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?
 
Rajkamal Pillai
Ranch Hand
Posts: 445
1
Java Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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: 445
1
Java Spring
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic