Posted By:
Elisabeth_Bachler
Posted On:
Tuesday, September 18, 2001 01:17 AM
Hello, I am building a web application that connects to a LDAP database. I am using JSP and Beans but I don't think I am using the beans the way I should. For the moment, I have a single bean that does the connexion to the database as well as the access operations (search, etc). In all the jsp files, the scope is "session". I don't think this is a good idea to have only one bean containning all the variables. I would like to have a ConnectionManager bean (scope=session) that only connects to the dataBase, a WebBean (scope=page) that does the rest. I am correct to assume it is better or is it a better way ?
More>>
Hello,
I am building a web application that connects to a LDAP database.
I am using JSP and Beans but I don't think I am using the beans the
way I should.
For the moment, I have a single bean that does the connexion
to the database as well as the access operations (search, etc).
In all the jsp files, the scope is "session". I don't think this is a
good idea to have only one bean containning all the variables.
I would like to have a ConnectionManager bean (scope=session) that only connects
to the dataBase, a WebBean (scope=page) that does the rest.
I am correct to assume it is better or is it a better way ?
My problem is that if, inside COnnectionManager I realize the
LDAP connection:
LDAPConnection ld=new LDAPConnection();
ld.connect(ldapServer,ldapPort,bindDN,bindPassword);
etc.
How am I going to be able to access the database pointer (ld) in the other
beans? (ld.search ....)
Do I need to call all the functions with this parameter?
All advice will be welcome.
Thanks
Elisabeth
<<Less