Java Web之Servlet-02 应用MVC架构实现项目 Posted on 2015-04-15 Edited on 2020-06-27 In Java 1. 获取初始化参数12345678910<servlet> <init-param> <param-name>username</param-name> <param-value>admin</param-value> </init-param> <init-param> <param-name>password</param-name> <param-value>123456</param-value> </init-param></servlet> 123在servlet的init()方法中获取初始化的值:this.getInitParameter("username");this.getInitParameter("password");