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

B

Ben Jessel

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.
 
J

Jeyakumar

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top