conf/web.xml配置文件 data xxxxx servlet资源文件 public class ServletDemo extends HttpServlet{ public void doGet{HttpServletRequest request, HttpServletResponse response} throws ServletException, IOException{ String value = this.getServletConfig().getInitPatameter("data"); //将得到 value=xxxxx } }