Which implicit object is used in a JSP page to retrieve values associated with <context-param> entries in the deployment descriptor? A. config B. request C. session D. application Answer: D web.xml裡面可以設定兩種參數: Context初始參數 -- 使用(context-param) 及 Servlet初始參數 -- 使用(servlet-name) (1)Context初始參數,是屬於web全堿變數,與JSP的application變數相同,在web.xml中配置如下: <context-param> <param-name>test</param-name> <param-value>33</param-value> </context-param> (2)Servlet初始參數,只屬於此servlet可以使用這變數,在web.xml中配置如下: <servlet> ... <init-param> <param-name>paramTest1</param-name> <param-value>123</param-value> </init-param> </servlet> 相關資料:
文章標籤
全站熱搜
