You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2014/02/24 14:10:19 UTC

[jira] [Comment Edited] (CXF-5575) Extra slash ('/') is prefixed to redirect URL in "redirects-list"

    [ https://issues.apache.org/jira/browse/CXF-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13910271#comment-13910271 ] 

Sergey Beryozkin edited comment on CXF-5575 at 2/24/14 1:08 PM:
----------------------------------------------------------------

Hi, where do you see the extra "/" being added ?

Is it in the private HttpServletRequestFilter#getRequestURI ? 

or in AbstsractHttpServlet.redirect(), when we have

sc.getRequestDispatcher(theServletPath + pathInfo); ?

Cheers, Sergey


was (Author: sergey_beryozkin):
Hi, where do you the extra "/" being added ?

Is it in the private HttpServletRequestFilter#getRequestURI ? 

or in AbstsractHttpServlet.redirect(), when we have

sc.getRequestDispatcher(theServletPath + pathInfo); ?

Cheers, Sergey

> Extra slash ('/') is prefixed to redirect URL in "redirects-list"
> -----------------------------------------------------------------
>
>                 Key: CXF-5575
>                 URL: https://issues.apache.org/jira/browse/CXF-5575
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.0-milestone2
>         Environment: jetty 9.1.2
>            Reporter: Aurius Bendikas
>            Priority: Blocker
>
> Using jetty 9.1.2 and latest CXF SNAPSHOT.
> Exception is thrown if trying to load i.e. "index.jsp":
> javax.servlet.ServletException: RequestDispatcher for path /index.jsp has failed
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.redirect(AbstractHTTPServlet.java:364) ~[cxf-rt-transports-http-3.0.0-SNAPSHOT.jar:3.0.0.SNAPSHOT]
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:274) ~[cxf-rt-transports-http-3.0.0-SNAPSHOT.jar:3.0.0.SNAPSHOT]
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:211) ~[cxf-rt-transports-http-3.0.0-SNAPSHOT.jar:3.0.0.SNAPSHOT]
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) ~[javax.servlet-api-3.1.0.jar:3.1.0]
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262) ~[cxf-rt-transports-http-3.0.0-SNAPSHOT.jar:3.0.0.SNAPSHOT]
> 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:717) ~[jetty-servlet-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1644) ~[jetty-servlet-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at ch.qos.logback.classic.selector.servlet.LoggerContextFilter.doFilter(LoggerContextFilter.java:70) ~[logback-classic-1.1.1.jar:na]
> 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1615) ~[jetty-servlet-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) [jetty-servlet-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568) [jetty-security-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221) [jetty-server-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1112) [jetty-server-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:479) [jetty-servlet-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183) [jetty-server-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1046) [jetty-server-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.server.Server.handle(Server.java:459) [jetty-server-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:281) [jetty-server-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232) [jetty-server-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505) [jetty-io-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607) [jetty-util-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536) [jetty-util-9.1.2.v20140210.jar:9.1.2.v20140210]
> 	at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
> I have done some debugging and looks like CXF is adding extra '/' to the beginning of redirect URL. That makes jetty jsp servlet return error that //index.jsp is not found.
> Servlet configuration:
> <servlet>
>     <servlet-name>CXFServlet</servlet-name>
>     <servlet-class>org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet</servlet-class>
>     <init-param>
>         <param-name>javax.ws.rs.Application</param-name>
>         <param-value>net.aurius.guestlist.GuestListApplicationConfig</param-value>
>     </init-param>
>     <init-param>
>         <param-name>redirects-list</param-name>
>         <param-value>/(\w)+.jsp</param-value>
>     </init-param>
>     <init-param>
>         <param-name>redirect-servlet-name</param-name>
>         <param-value>jsp</param-value>
>     </init-param>
>     <init-param>
>         <param-name>redirect-attributes</param-name>
>         <param-value>javax.servlet.include.request_uri</param-value>
>     </init-param>
>     <load-on-startup>1</load-on-startup>
> </servlet>
> <servlet-mapping>
>     <servlet-name>CXFServlet</servlet-name>
>     <url-pattern>/*</url-pattern>
> </servlet-mapping>



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)