《JSP完全学习手册》学习心得:隐含对象config
<%@page contentType="text/html;charset=GB2312"%>
<%@page import = "java.util.Enumeration"%>
<%
Enumeration params = config.getInitParameterNames();
while(params.hasMoreElements()){
String name = (String)params.nextElement();
String value = config.getInitParameter(name);
out.println(name + "=" + value);
out.println("<br />");
}
/*
<servlet>
<servlet-name>config</servlet-name>
<jsp-file>/ch5/config.jsp</jsp-file>
<init-param>
<param-name>FirstName</param-name>
<param-value>Tom.</param-value>
</init-param>
<init-param>
<param-name>LastName</param-name>
<param-value>Tim.</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>config</servlet-name>
<url-pattern>/jspConfig</url-pattern>
</servlet-mapping>
*/
%>
posted on 2009-05-27 23:54
天堂露珠 阅读(223)
评论(0) 编辑 收藏 所属分类:
JSP