You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by in...@projektinter.net on 2002/09/09 19:12:59 UTC

Re: PLEASE IGNORE: ServletContext in a Bean

somehow a double posting. Please ignore!

rainer


----- Original Message -----
From: "rainer juenger" <ja...@projektinter.net>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Monday, September 09, 2002 4:25 PM
Subject: ServletContext in a Bean


Hi,

how can I access the ServeltContext in a bean?
Could you give me sample:

e.g.

import javax.servlet.*;

// something like that, but getServletConfig() is of course not known in a
normal bean.
ServletContext ctx = getServletConfig().getServletContext();
String dbdriver = ctx.getAttribute(Constants.DBDRIVER);

thanks for any help!

Rainer




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>