cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (Commented) (JIRA)" <>
Subject [jira] [Commented] (CXF-4190) <static-resources-list> directive fails with directories
Date Thu, 22 Mar 2012 10:06:22 GMT


Sergey Beryozkin commented on CXF-4190:

Hi, this sounds reasonable.
I'd propose to keep the original check and then proceed to checking if it is a directory within
the if (is == null) branch, as I guess some non-directory might have no extensions too.
Please attach a patch, thanks
> <static-resources-list> directive fails with directories
> --------------------------------------------------------
>                 Key: CXF-4190
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: Services, Transports
>    Affects Versions: 2.4, 2.5
>         Environment: CXF/Spring on Tomcat 6.x
>            Reporter: IngyHere
>   Original Estimate: 24h
>  Remaining Estimate: 24h
> The "static-resources-list" directive is provided as an alternative to serve static content
through the service root and as an alternative to flying one's own DispatcherServlet. Unfortunately,
it works only for files. This leads to the situation where people are going nuts trying to
make workarounds when they set their base url-pattern directive to something like "/*" or
they simply want to serve content directly under the service path. (See
for a comparable situation.) 
> The code at "org.apache.cxf.transport.servlet.AbstractHTTPServlet" in "serveStaticContent"
provides an immediate check for content with 
> {code:title=Snippet|borderStyle=dashed}
> InputStream is = super.getServletContext().getResourceAsStream(pathInfo);
>         if (is == null) {
>             throw new ServletException("Static resource " + pathInfo + " is not available");
>         }
> {code}
> and, when this fails due a directory being passed in through the request, it's exception
> An algorithm for serving static content should be implemented that assumes without an
extension that the item passed in is a directory (and/or checks first for a trailing slash)
and then attempts to serve up the name of the welcome file in the directory. 
> Alternately, this could all be just passed off to DefaultDispatcher to let it handle
the edge cases. 
> Basically, this bug makes the "static-resources-list" directive effectively useless.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message