struts inheritence

Discussion in 'Java' started by analogueboy, Apr 14, 2004.

  1. analogueboy

    analogueboy Guest

    I tried to subclass ActionForm to create my own base form which I could
    extend in my apps. However, the subclasses of my base form seem to be
    sharing the same base form! I thought that as part of the language this
    would not happen, now I've had to pull all the code from the base class into
    my subclasses which defeats the original purpose.

    Has anyone else had this problem? How did you get around it?
     
    analogueboy, Apr 14, 2004
    #1
    1. Advertisements

  2. analogueboy

    Guest

    On Wed, 14 Apr 2004 13:41:40 +0100, "analogueboy"
    <> wrote:

    >I tried to subclass ActionForm to create my own base form which I could
    >extend in my apps. However, the subclasses of my base form seem to be
    >sharing the same base form! I thought that as part of the language this
    >would not happen, now I've had to pull all the code from the base class into
    >my subclasses which defeats the original purpose.
    >
    >Has anyone else had this problem? How did you get around it?
    >


    You should be able to do what you want. You did give the forms
    different names in your struts config right?

    Pete
     
    , Apr 17, 2004
    #2
    1. Advertisements

  3. analogueboy

    Andrew S. Guest

    "analogueboy" <> wrote in message news:<djafc.472$>...
    > I tried to subclass ActionForm to create my own base form which I could
    > extend in my apps. However, the subclasses of my base form seem to be
    > sharing the same base form! I thought that as part of the language this
    > would not happen, now I've had to pull all the code from the base class into
    > my subclasses which defeats the original purpose.
    >
    > Has anyone else had this problem? How did you get around it?


    In the struts-config.xml make sure each of your forms are defined at
    request scope - otherwise concurrent http requests will share the same
    form instance.

    Andrew
     
    Andrew S., Apr 19, 2004
    #3
    1. Advertisements

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. Katie Wright
    Replies:
    8
    Views:
    4,795
    Andrea Desole
    Jan 7, 2005
  2. Jason Us
    Replies:
    0
    Views:
    1,192
    Jason Us
    Oct 4, 2003
  3. jc1771
    Replies:
    0
    Views:
    592
    jc1771
    Dec 28, 2003
  4. sin
    Replies:
    3
    Views:
    869
    Sudsy
    Feb 22, 2004
  5. Pratap Das
    Replies:
    2
    Views:
    2,347
    Pratap Das
    Apr 5, 2004
  6. Aleksandar Matijaca
    Replies:
    2
    Views:
    10,322
    Aleksandar Matijaca
    Sep 19, 2004
  7. Replies:
    0
    Views:
    1,446
  8. Merlijn
    Replies:
    0
    Views:
    4,453
    Merlijn
    Mar 24, 2006
Loading...