I set a bean in servlet 1 like this:
ServletContext context = config.getServletContext();
// Instantiating the DbBean
DbBean dbBean = new DbBean();
// Initialize the DbBean's fields
// dbBean.setDbUserName(config.getInitParameter("dbUserName"));
// dbBean.setDbPassword(config.getInitParameter("dbPassword"));
// put the bean in the servlet context
// the bean will be accessed from JSP
context.setAttribute("dbBean", dbBean);
My question is, how can i access this bean from another servlet, not a
JSP but a servlet?
Johann Burkard - 09 Sep 2003 19:50 GMT
neoivan schrob:
> ServletContext context = config.getServletContext();
[...]
> context.setAttribute("dbBean", dbBean);
>
> My question is, how can i access this bean from another servlet, not a
> JSP but a servlet?
By DBBean bean = (DBBean) context.getAttribute("dbBean"); if thats what you
meant.
Johann

Signature
If you had arguments, you wouldn't need to declare your discussion partner
a residental kook.
(Das Enezian ?ber sich in <3D8962F7.55C9429C@munged.adresses>)