String file = this.getInitParameter(“file”);
System.out.println(file);
String realPath = this.getServletContext().getRealPath(file);
System.out.println(realPath);
Properties p = new Properties();
p.load(new FileInputStream(realPath));
String username = p.getProperty(“username”);
String password = p.getProperty(“password”);
System.out.println(username,password);
Servlet 就是一个类,它继承了httpservlet, 要求实现它几个方法
doGet()、doPost()、
由容器对其进行实例化,tomcat容器
生命周期:实例化、初始化、doGet()、doPost()、destroy销毁
servlet配置:在web.xml中进行配置,在myeclipse中不需要手工配置,servlet-mapping对应一个映射
servlet就是一个控制层