获取web.xml简单方法

来源:互联网 发布:汤臣倍健vb功效与作用 编辑:程序博客网 时间:2024/06/06 16:09
servlet
 public void doGet(HttpServletRequest request, HttpServletResponse response)   throws ServletException, IOException {  Enumeration e = getInitParameterNames();  while (e.hasMoreElements()) {   String funName = (String) e.nextElement();   String funClass = getInitParameter(funName);  } }


web.xml

  <servlet>    <description>This is the description of my J2EE component</description>    <display-name>This is the display name of my J2EE component</display-name>    <servlet-name>TestServlet</servlet-name>    <servlet-class>com.dong.test.servlet.TestServlet</servlet-class>    <init-param>    <param-name>drf</param-name> <param-value>123</param-value> </init-param>  </servlet>


 

原创粉丝点击