File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Submitted Form values are repeated across Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Submitted Form values are repeated across" Watch "Submitted Form values are repeated across" New topic
Author

Submitted Form values are repeated across

Smitesh Shinde
Ranch Hand

Joined: Feb 16, 2008
Posts: 45

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

Joined: Mar 02, 2005
Posts: 443
    
    1

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

Joined: Feb 16, 2008
Posts: 45

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

Joined: Mar 02, 2005
Posts: 443
    
    1

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.
 
 
subject: Submitted Form values are repeated across
 
Similar Threads
<jsp:setProperty> sets null values in the bean
Bean declarations in struts
Page Bean not setting text property
Skip form validation but update backing bean values
DynaActionForm