[
https://issues.apache.org/struts/browse/WW-2849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44875#action_44875
]
Musachy Barroso commented on WW-2849:
-------------------------------------
Yes, you are right, this was a problem with a merge (not much of a merge as the
classes are different in trunk and 2.0), in trunk, on filter dispatcher:
if (staticResourceLoader.canHandle(resourcePath)) {
staticResourceLoader.findStaticResource(resourcePath, request, response);
} else {
// this is a normal request, let it pass through
chain.doFilter(request, response);
}
in 2.0:
if (serveStatic && resourcePath.startsWith("/struts")) {
String name = resourcePath.substring("/struts".length());
findStaticResource(name, request, response);
} else {
// this is a normal request, let it pass through
chain.doFilter(request, response);
}
> Unable to access static content
> -------------------------------
>
> Key: WW-2849
> URL: https://issues.apache.org/struts/browse/WW-2849
> Project: Struts 2
> Issue Type: Bug
> Components: Dispatch Filter
> Affects Versions: 2.0.12
> Reporter: Julien HENRY
> Priority: Blocker
>
> Hi,
> I'm testing Struts 2.0.12 and always have the "dojo is not defined" error.
> Looking at the source code of the page, there is a javascript import of
> http://foo/myapp/struts/dojo/dojo.js. But when I try to access this URL in my
> browser I get a 404 error. Looking at the source code of FilterDispatcher, it
> seems that the latest patch (SVN revision 687874) broke static content.
> The problem is :
> (In doFilter() line 411)
> String name = resourcePath.substring("/struts".length());
> (In findStaticResource line 443)
> String name = cleanupPath(path);
> with basically do path.substring(7) to also remove the "/struts" prefix.
> As a result the content path of my "/struts/dojo/dojo.js" request become
> "ojo.js" and then 404.
> According to me the fix would be to remove
> String name = cleanupPath(path);
> and also remove the ugly
> cleanupPath(path)
> methods.
> Steps to reproduce: just try to run this application with 2.0.12 :
> http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.