Hi all, decided to post the recent issue I discovered with struts 2 here
before submitting a jira bug -- need to determine if this was a bug to begin
with :)
Essentially, we have all actions of struts 2 mapped to * -- no extension.
One of the action handlers uses the following path:
www.blah.com/web-app/action/parameter. This setup works well in most cases
except when the parameter we use contains a dot (.), example:
www.blah.com/web-app/action/parameter.com. For some reason, the
org.apache.struts2.dispatcher.mapper.DefaultActionMapper will return null
mapping for this. After a brief look into the source, I've noticed that
dropExtension method contains code that determines if this is right mapping
or not based on an empty extension and this code:
int index = name.lastIndexOf('.');
if (index == -1 || name.indexOf('/', index) >= 0) {
return name;
}
Lines 467-470.
I've modified this for our local struts installation, tho this needs to be
resolved in the core build, I think the dropExtension only when extensions
are defined in the struts.xml or mapping. Also, what was the case for this
item to begin with? Thanks!
Felix.