Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts form contains data the first time you arrive at the page

Reply
Thread Tools

Struts form contains data the first time you arrive at the page

 
 
Ben Jessel
Guest
Posts: n/a
 
      11-20-2003
Hi,

I've got a struts form. It has a rest method implemented. However,
when I go to the page with the input fields of the form, they are
populated with data that I have entered some time before. As if the
form is not being reset once it has been finished with. Is there some
setting to clear it once the Struts Action associated with it has
called return mapping.findforward()? I notice that reset is called
after submission, just before it is populated by the controller. Reset
it not called the very first time that the form is displayed. I cannot
clear it with javascript as this may cause problems when I am returned
to the form if I've missed a field.
 
Reply With Quote
 
 
 
 
Jeyakumar
Guest
Posts: n/a
 
      11-20-2003
Implementing two action should this issue like action="Create" and
action="Edit". When an action is called first time the

action="Create" forwards to mapping.getInputforward() which is the JSP or
HTML page configured for the form input. For the action "Edit" the form is
populated from DB. Hope it is useful..

Regards

Jay

"Ben Jessel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hi,
>
> I've got a struts form. It has a rest method implemented. However,
> when I go to the page with the input fields of the form, they are
> populated with data that I have entered some time before. As if the
> form is not being reset once it has been finished with. Is there some
> setting to clear it once the Struts Action associated with it has
> called return mapping.findforward()? I notice that reset is called
> after submission, just before it is populated by the controller. Reset
> it not called the very first time that the form is displayed. I cannot
> clear it with javascript as this may cause problems when I am returned
> to the form if I've missed a field.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Probelm to post XML data in a loop. First time XML is posted, second time data is getting truncated. Please help. vamsi.aluru@gmail.com Perl Misc 7 02-14-2006 12:09 PM
GeForce 7800GT to arrive on August 11th Silverstrand Front Page News 2 07-25-2005 06:32 AM
Read form "name" attribute when it contains form field with name "name" Pavils Jurjans Javascript 3 03-18-2005 01:39 PM
Regex problem, match if line contains <a>, unless it also contains <b> James Dyer Perl 5 02-20-2004 12:29 PM
Learning python 2nd takes time to arrive. sebb Python 0 12-18-2003 12:33 AM



Advertisments