【发布时间】:2014-03-18 22:40:31
【问题描述】:
我有一个 Swing-App,它可以在没有 web.xml 的情况下启动嵌入式 tomcat7 服务器。我加载了一个使用 jstl 的 jsp。当我访问 jsp 时,我的 Swing-App 中出现此错误:
18.02.2014 22:32:54 org.apache.jasper.compiler.WebXml <init>
WARNUNG: Internal Error: File /WEB-INF/web.xml not found
18.02.2014 22:32:54 org.apache.jasper.compiler.WebXml <init>
WARNUNG: Internal Error: File /WEB-INF/web.xml not found
18.02.2014 22:32:54 org.apache.catalina.core.ApplicationDispatcher invoke
SCHWERWIEGEND: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: The absolute uri: http://www.irquest.com/irq cannot be resolved in either web.xml or the jar files deployed with this application
在 jsp 中我使用这些标记库:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
我使用 jstl 1.1.2 和标准 1.1.2。这些库包含在我的 pom 中:
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
这是我配置上下文的方式:
Context jqs3context = null;
try {
jqs3context = tomcat.addWebapp("/" + servletContainerSettings.getServletContext(), servletContainerSettings.getHtdocsHome());
} catch (ServletException e) {
e.printStackTrace();
}
Wrapper wrapper = Tomcat.addServlet(jqs3context, "JQS3", servletContainerSettings.getServletClass());
//[..] wrapper init params here [..]
jqs3context.addServletMapping("/" + servletContainerSettings.getServletName() + "/*", "JQS3");
jqs3context.setCrossContext(true);
jqs3context.setLoader(new WebappLoader());
jqs3context.setResources(new FileDirContext());
jqs3context.getNamingResources().addResource(createDatabaseResource("jdbc/iradmindb"));
这发生在我将嵌入式 tomcat5.5 升级到 tomcat7 之后。 我不知道为什么我会收到这个错误。我错过了什么?
【问题讨论】:
标签: java jsp jstl embedded-tomcat-7