[ http://issues.apache.org/struts/browse/WW-1451?page=comments#action_38264 
] 
            
Don Brown commented on WW-1451:
-------------------------------

Unfortunately, I don't think that will work, because the actual action config 
isn't resolved until the constructor of the DefaultActionProxy class.   We 
could look up the action config in the mapper, but then it would go through 
that code twice.  The better solution is to rethink how that ActionConfig 
lookup process works at a higher level.

> struts.action.extension=html
> ----------------------------
>
>                 Key: WW-1451
>                 URL: http://issues.apache.org/struts/browse/WW-1451
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Dispatch
>    Affects Versions: 2.0.0
>            Reporter: Mike McMahon
>            Priority: Minor
>
> Some folks (such as AppFuse) like to set struts.action.extension=html
> Thats fine but that it becomes impossible to use Strut's Dojo widgets like
> struts/dojo/struts/widgets/BindButton.html  due to a "no Action mapped " 
> exception
> It would be pretty simple to modify FilterDispatcher.doFilter as below to 
> first look for an
> action mapping, and if none is found, then check to see if Struts would 
> otherwise serve
> an internal static resource.
>         if (mapping == null ||
>         (mapping.getMethod() == null && ("").equals(mapping.getNamespace()) 
> && mapping.getParams() == null && mapping.getResult() == null
>         && 
> "true".equals(Settings.get(StrutsConstants.STRUTS_SERVE_STATIC_CONTENT)))) {  
>   
>             // there is no action in this request, should we look for a 
> static resource?
>             String resourcePath = RequestUtils.getServletPath(request);
>             if ("".equals(resourcePath) && null != request.getPathInfo()) {
>                 resourcePath = request.getPathInfo();
>             }
>             if 
> ("true".equals(Settings.get(StrutsConstants.STRUTS_SERVE_STATIC_CONTENT))
>                     && resourcePath.startsWith("/struts")) {
>                 String name = resourcePath.substring("/struts".length());
>                 findStaticResource(name, response);
>                 return;
>             } else if (mapping == null){
>                 // this is a normal request, let it pass through
>                 chain.doFilter(request, response);
>             }
>             if (mapping == null)  // The framework did its job here
>             return;
>         }
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to