I'm using Spring with Jetty. Until now I haven't used JSP's, but I have a 3rd party servlet that uses them.
It appears in the logs that Jetty is trying to load a "jsp" servlet. But I want all requests to go through to springs dispatcher servlet.
What can I do to stop Jetty from intercepting *.jsp?
web.xml
<web-app xmlns:...
<!-- ~~~~~~~~~~~~~~~ SPRING DISPATCHER SERVLET ~~~~~~~~~~~~~~~ -->
<!-- Allows Spring to handle all web requests -->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- ~~~~~~~~~~~~~~~ SPRING SECURITY HOOK ~~~~~~~~~~~~~~~ -->
<!-- removed for clarity -->
<!-- ~~~~~~~~~~~~~~~ BEAN SCOPES FOR WEB ~~~~~~~~~~~~~~~ -->
<!-- removed for clarity -->
</web-app>
Jetty logs for a non-JSP request:
28902 [qtp1620636050-15 - /myaccount/transactions] DEBUG org.eclipse.jetty.util.log - REQUEST /myaccount/transactions on org.eclipse.jetty.server.nio.SelectChannelConnector$3@52d85409
28902 [qtp1620636050-15 - /myaccount/transactions] DEBUG org.eclipse.jetty.util.log - Got Session ID 1x85qr20xozki139cfcd6a520o from cookie
28902 [qtp1620636050-15 - /myaccount/transactions] DEBUG org.eclipse.jetty.util.log - sessionManager=org.eclipse.jetty.server.session.HashSessionManager@21e3cc77
28902 [qtp1620636050-15 - /myaccount/transactions] DEBUG org.eclipse.jetty.util.log - session=org.eclipse.jetty.server.session.HashSessionManager$HashedSession:1x85qr20xozki139cfcd6a520o@1420624050
28902 [qtp1620636050-15 - /myaccount/transactions] DEBUG org.eclipse.jetty.util.log - servlet=dispatcher
28903 [qtp1620636050-15 - /myaccount/transactions] DE开发者_运维知识库BUG org.eclipse.jetty.util.log - servlet holder=
28903 [qtp1620636050-15 - /myaccount/transactions] DEBUG org.eclipse.jetty.util.log - chain=
28903 [qtp1620636050-15 - /myaccount/transactions] DEBUG org.eclipse.jetty.util.log - call filter springSecurityFilterChain
Jetty logs for a JSP request:
398317 [qtp1620636050-14 - /console/login.jsp] DEBUG org.eclipse.jetty.util.log - REQUEST /console/login.jsp on org.eclipse.jetty.server.nio.SelectChannelConnector$3@1eaf0e38
398317 [qtp1620636050-14 - /console/login.jsp] DEBUG org.eclipse.jetty.util.log - Got Session ID 1x85qr20xozki139cfcd6a520o from cookie
398317 [qtp1620636050-14 - /console/login.jsp] DEBUG org.eclipse.jetty.util.log - sessionManager=org.eclipse.jetty.server.session.HashSessionManager@21e3cc77
398318 [qtp1620636050-14 - /console/login.jsp] DEBUG org.eclipse.jetty.util.log - session=org.eclipse.jetty.server.session.HashSessionManager$HashedSession:1x85qr20xozki139cfcd6a520o@1420624050
398318 [qtp1620636050-14 - /console/login.jsp] DEBUG org.eclipse.jetty.util.log - servlet=jsp
398319 [qtp1620636050-14 - /console/login.jsp] DEBUG org.eclipse.jetty.util.log - servlet holder=
398319 [qtp1620636050-14 - /console/login.jsp] DEBUG org.eclipse.jetty.util.log - chain=
398319 [qtp1620636050-14 - /console/login.jsp] DEBUG org.eclipse.jetty.util.log - call filter springSecurityFilterChain
Add a <servlet-mapping>*.jsp</servlet-mapping>
to map this extension to your dispatcher servlet.
精彩评论