Re: Form bean and class instance question

2002-01-30 Thread Marcus Brito

Em Ter, 2002-01-29 às 17:48, Bryan P. Glennon escreveu:
> I must be missing something... 
> 
> I have a class, Foo, whose data I want to display in a form. I have
> defined an action (NavigateAction) that is invoked when the user makes a
> selection which will move him/her to the page to disply Foo. This action
> locates the correct instance of Foo and puts it in a session attribute.
> I also have a form bean (FooBean) that is associated with the FooAction.
> This action populates FooBean from information in the Foo object. Right
> now, I have pretty much duplicated the public interface from Foo in
> FooBean. It seems like there must be a better way to do this. Anyone
> care to enlighten me?

Take a look at XDoclet[1]. If you code your application "The XDoclet
Way", it should take care of generating much of your code, including
Struts form classes.

-- 
Ja ne,
   Pazu
   mailto: [EMAIL PROTECTED]

Anime Gaiden: de fãs para fãs, sempre.



signature.asc
Description: This is a digitally signed message part


RE: Form bean and class instance question

2002-01-29 Thread Vaughan Jackson

Bryan,

Isn't this really a question of how you want to do it?
You may want to duplicate the Foo bean interface in the 
FooBean form bean, or you may access the Foo bean directly
from the session in your JSP.

Struts form beans provide a convenient way to represent 
the values on a page, as well as some form validation 
support.

Vaughan.

> -Original Message-
> From: Bryan P. Glennon [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 29, 2002 11:48 AM
> To: [EMAIL PROTECTED]
> Subject: Form bean and class instance question
> 
> 
> I must be missing something... 
> 
> I have a class, Foo, whose data I want to display in a form. I have
> defined an action (NavigateAction) that is invoked when the 
> user makes a
> selection which will move him/her to the page to disply Foo. 
> This action
> locates the correct instance of Foo and puts it in a session 
> attribute.
> I also have a form bean (FooBean) that is associated with the 
> FooAction.
> This action populates FooBean from information in the Foo 
> object. Right
> now, I have pretty much duplicated the public interface from Foo in
> FooBean. It seems like there must be a better way to do this. Anyone
> care to enlighten me?
> 
> Thanks,
> Bryan
> 
> --
> Bryan Glennon (mailto:[EMAIL PROTECTED])
> BPG Consulting, Inc. (http://www.bpgc.com)
> Tech Question? (mailto:[EMAIL PROTECTED])
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 
> 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Form bean and class instance question

2002-01-29 Thread Bryan P. Glennon

I must be missing something... 

I have a class, Foo, whose data I want to display in a form. I have
defined an action (NavigateAction) that is invoked when the user makes a
selection which will move him/her to the page to disply Foo. This action
locates the correct instance of Foo and puts it in a session attribute.
I also have a form bean (FooBean) that is associated with the FooAction.
This action populates FooBean from information in the Foo object. Right
now, I have pretty much duplicated the public interface from Foo in
FooBean. It seems like there must be a better way to do this. Anyone
care to enlighten me?

Thanks,
Bryan

--
Bryan Glennon (mailto:[EMAIL PROTECTED])
BPG Consulting, Inc. (http://www.bpgc.com)
Tech Question? (mailto:[EMAIL PROTECTED])

--
To unsubscribe, e-mail:   
For additional commands, e-mail: