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

Discussion in 'Java' started by Ben Jessel, Nov 20, 2003.

  1. Ben Jessel

    Ben Jessel Guest

    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.
    Ben Jessel, Nov 20, 2003
    #1
    1. Advertising

  2. Ben Jessel

    Jeyakumar Guest

    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" <> wrote in message
    news:...
    > 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.
    Jeyakumar, Nov 20, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Dyer
    Replies:
    5
    Views:
    643
  2. sebb
    Replies:
    0
    Views:
    288
  3. Replies:
    3
    Views:
    356
  4. Matt Moran
    Replies:
    0
    Views:
    130
    Matt Moran
    Jul 10, 2003
  5. reo

    post arrive empty

    reo, Apr 8, 2004, in forum: ASP General
    Replies:
    0
    Views:
    117
Loading...

Share This Page