在没有连接网络的环境下,启动Tomcat提示如下错误:
-Can't create Tiles definition factory for module ''.
Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.
javax.servlet.ServletException: IO Error while parsing file '/WEB-INF/tiles-defs.xml'. jakarta.apache.org
原因是 tiles-defs.xml 中的 tiles-config_1_3.dtd 地址是来自网络,而非本地的。可以将其修改为本地:
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
"../webapps/项目名/WEB-INF/tiles-config_1_3.dtd">
即可。