我用如下方法(在web.xml文件中以定义
             <context-param>
<param-name>driver</param-name>
<param-value>com.microsoft.jdbc.sqlserver.SQLServerDriver</param-value>
             </context-param>
             )
ServletContext context = getServletContext();
String driver=context.getInitParameter("driver"); 
不过运行时在ServletContext context = getServletContext();这句出现NullPointerException而我用同样的方法,可以在servlet中正确运行
请问这是为什么?
有没有别的方法可以取得这个driver呢?
谢谢