struts and form validation

Discussion in 'Java' started by Scott Phelps, May 4, 2005.

  1. Scott Phelps

    Scott Phelps Guest

    I have two forms that I submit both do validation, one keeps the form
    entries on errors one does not.

    The only thing that I can see that is different (maybe im doing something
    wrong) is that I load a bean in one and not another.

    ie
    first one that does not keep entries on errors

    <html:form action="/entry" name="curr" type="org.my.struts..myForm">


    the other that does

    <html:form action="/entry">

    How do I make the first keep form entries on errors, and still be able to
    load entries from the session?

    Thanks
    Scott Phelps, May 4, 2005
    #1
    1. Advertising

  2. Scott Phelps

    Wendy Smoak Guest

    "Scott Phelps" <> wrote:

    > I have two forms that I submit both do validation, one keeps the form
    > entries on errors one does not.


    What do the <action> mappings in struts-config.xml look like?
    I'm guessing that one has session scope, and the other, request scope.

    --
    Wendy S
    Wendy Smoak, May 4, 2005
    #2
    1. Advertising

  3. Scott Phelps

    Scott Phelps Guest

    "Wendy Smoak" <> wrote in message
    news:d5bd4r$7i0$...
    > "Scott Phelps" <> wrote:
    >
    >> I have two forms that I submit both do validation, one keeps the form
    >> entries on errors one does not.

    >
    > What do the <action> mappings in struts-config.xml look like?
    > I'm guessing that one has session scope, and the other, request scope.
    >
    > --
    > Wendy S
    >
    >


    No they are both session. Could the differenct be that one is using a bean
    to populate the fields, the other is not? but even so wouldn't the fields be
    popluated on the finding of the error?

    Thanks
    Scott Phelps, May 6, 2005
    #3
  4. Scott Phelps

    Wendy S Guest

    > "Scott Phelps" <> wrote:
    >
    > No they are both session. Could the differenct be that one is using a bean
    > to populate the fields, the other is not? but even so wouldn't the fields
    > be popluated on the finding of the error?
    >


    They're both using a bean to populate the fields... one is using the form
    bean that [I assume] you configured in struts-config.xml, and the other is
    using the one that you put in the <html:form> tag.

    Without seeing the <action> mappings from struts-config, it's a waste of
    time for me to keep guessing. Also, what URLs are you visiting to view the
    forms? Are you doing anything interesting in the Action code?

    --
    Wendy
    Wendy S, May 7, 2005
    #4
    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. Leo Gaggl
    Replies:
    0
    Views:
    1,013
    Leo Gaggl
    Apr 5, 2004
  2. Sumith Mathur
    Replies:
    0
    Views:
    2,191
    Sumith Mathur
    Sep 23, 2004
  3. javadude
    Replies:
    0
    Views:
    719
    javadude
    Feb 16, 2005
  4. D. Mantelos
    Replies:
    9
    Views:
    7,410
    smshashi
    May 3, 2007
  5. bnp
    Replies:
    4
    Views:
    299
Loading...

Share This Page