0

我有一个示例 web.xml,如下所示

<servlet>
    <servlet-name>Authorize</servlet-name>
    <jsp-file>/WEB-INF/jsp/facebook/authorize.jsp</jsp-file>
</servlet>

<servlet>
    <servlet-name>postAuthorize</servlet-name>
    <jsp-file>/WEB-INF/jsp/facebook/post_authorize.jsp</jsp-file>
</servlet>

<servlet>
    <servlet-name>referrerLink</servlet-name>
    <jsp-file>/WEB-INF/jsp/facebook/refer.jsp</jsp-file>
</servlet>

<servlet>
    <servlet-name>checkin</servlet-name>
    <jsp-file>/WEB-INF/jsp/facebook/checkin.jsp</jsp-file>
</servlet>

如果我访问/checkins/facebook/refer(签入是我的上下文路径),我将得到以下堆栈跟踪。

javax.servlet.ServletException: No servlet class has been specified for servlet referrerLink
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)

我有 jsp 目录和 WEB-INF。

4

1 回答 1

2

如果该属性metadata-complete="true"存在于 web.xml 的顶级元素中,请尝试将其删除。

于 2012-08-27T22:33:31.013 回答