I have set up a mechanism similar to Tomcat's Realm at the app level. It is
used to identify the database name(jndi),tables and columns that contain
user and role information in the database. At the start of my app the
database information is placed into an application scope bean using
digester. Then whenever a secure url is requested I have a Filter class that
routes to the security Action upon request of secure url then to a specified
login form. When the login form is submitted a validation of the username
and password needs to occur. This is the point at which I have a logic bean
that validates against thte database. It does so by checking the specified
database,tables and columns for user validation etc...(there is much more
detail but I think this is sufficient to get the point). So, this explains
why I have a config bean and a need to pass info to the logic bean. All I
want to know is, is what I am doing proper form? Is it accepted practice to
pass a bean to a bean?

Also, please don't turn this into a discussion of "Why not use container
based security?" As a note, I already do in a round-about way. :-)

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-----Original Message-----
From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 30, 2002 12:03 PM
To: 'Struts Users Mailing List'
Subject: RE: Best Practice Question.


This is rather vague.  Why does your logicBean need your configBean?

Mark

-----Original Message-----
From: Phase Web and Multimedia [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 30, 2002 1:51 PM

I have a bean that is created when my app starts and it contains some
database table conifguration info (I'll call it my config bean). Later on in
an Action class another bean, that I'll call my logic bean, needs to access
the values of the config bean. Would it be proper to use the Action class to
pass the config bean to the logic bean and let the logic bean extract the
values or should I extract all the values from the config bean within the
Action class and pass the config info in a different manner.

Thanks,
Brandon Goodin

--
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]>

Reply via email to