private synchronized void init() throws Exception {
if (init) return;
Tomcat tomcat = getTomcatInstance();
context = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(context, "regular", new Bug49711Servlet());
Wrapper w = Tomcat.addServlet(context, "multipart", new Bug49711Servlet_multipart());
// Tomcat.addServlet does not respect annotations, so we have
// to set our own MultipartConfigElement.
w.setMultipartConfigElement(new MultipartConfigElement(""));
context.addServletMapping("/regular", "regular");
context.addServletMapping("/multipart", "multipart");
tomcat.start();
setPort(tomcat.getConnector().getLocalPort());
init = true;
}
TestStandardContext.java 文件源码
java
阅读 31
收藏 0
点赞 0
评论 0
项目:apache-tomcat-7.0.57
作者:
评论列表
文章目录