web.xml里面可以定義兩種參數(shù):
(1)application范圍內(nèi)的參數(shù),存放在servletcontext中,在web.xml中配置如下: ![]() ![]() ![]() ![]() (2)servlet范圍內(nèi)的參數(shù),只能在servlet的init()方法中取得,在web.xml中配置如下: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 在servlet中可以通過代碼分別取用: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 第一種參數(shù)在servlet里面可以通過getServletContext().getInitParameter("context/param")得到 |