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

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

  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. 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. Doug Nichols

    Inheritence question

    Doug Nichols, Feb 19, 2004, in forum: Perl
    Replies:
    0
    Views:
    454
    Doug Nichols
    Feb 19, 2004
  2. Kenton Smeltzer

    UserControl Inheritence Design Time Editing

    Kenton Smeltzer, Jan 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    337
    Kenton Smeltzer
    Jan 29, 2004
  3. jqpdev
    Replies:
    2
    Views:
    311
    jqpdev
    Feb 15, 2004
  4. Eric Biggs

    vs designer and code-behind inheritence

    Eric Biggs, Apr 14, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    313
    Eric Biggs
    Apr 14, 2004
  5. Mark
    Replies:
    1
    Views:
    640
Loading...

Share This Page