Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > struts inheritence

Reply
Thread Tools

struts inheritence

 
 
analogueboy
Guest
Posts: n/a
 
      04-14-2004
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?


 
Reply With Quote
 
 
 
 
nospam@tampabay.rr.com
Guest
Posts: n/a
 
      04-17-2004
On Wed, 14 Apr 2004 13:41:40 +0100, "analogueboy"
<(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
 
Andrew S.
Guest
Posts: n/a
 
      04-19-2004
"analogueboy" <(E-Mail Removed)> wrote in message news:<djafc.472$(E-Mail Removed)>...
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP: Visual Studio + Dreamweaver, Page Inheritence + Templates Mark ASP .Net 1 03-28-2005 01:39 PM
vs designer and code-behind inheritence Eric Biggs ASP .Net 0 04-14-2004 04:25 PM
Inheritence question Doug Nichols Perl 0 02-19-2004 01:08 PM
Web User Control Inheritence -- how to do? jqpdev ASP .Net 2 02-15-2004 11:15 PM
UserControl Inheritence Design Time Editing Kenton Smeltzer ASP .Net 0 01-29-2004 03:41 PM



Advertisments