Serving static content, when extension is empty
-----------------------------------------------

                 Key: WW-3086
                 URL: https://issues.apache.org/struts/browse/WW-3086
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.0.11.1
         Environment: Tomcat 5.5
            Reporter: Aravindan Ramkumar


I don't want .action or .do on the end of the url's, so I set 
struts.action.extension='' (empty string)

Now this leaves me with a bit of a problem serving static content, since struts 
swallows up all of my requests, and nothing gets through to the default 
servlet.  I opened up the code for FilterDispatcher and DefaultActionMapper. 
The FilterDispatcher would serve static files, if struts.constants.serve.static 
is true and the action mapper returns null. But the problem is if the extension 
is set as an empty string, DefaultActionMapper returns the name of the static 
file as the action name.  Struts cannot find a action with that name and 
forwards to the default action (if present) or throws an exception.

A quick and dirty way to fix this would be to patch the DefaultActionMapper or 
add a "black list" of urls to be ignored by FilterDispatcher. 

Please look at the discussion here

http://www.nabble.com/Struts2-static-content-td19784601.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to