在web.xml的<servlet>标签中增添
<init-param>
<param-name>XXX</param-name>
<param-value>XXX</param-value>
</init-param>
public void init() throws ServletException {
// Put your code here
this.setUsername(this.getInitParameter("username"));
this.setPassword(this.getInitParameter("password"));
}
时间: 2024-12-08 01:33:33