struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philipp Leusmann <>
Subject Re: Bug / Edge case
Date Thu, 18 Feb 2010 17:13:03 GMT
Hi Felix,

I also found this bug (?) some weeks ago. I think it belong to this jira issue, where I also
wrote my concerns: <>

An easy fix to bypass this, if you do not want to compile struts, is to override the ActionMapper
with your own implementation of dropExtension(String, ActionMapping) and set it in


Am 18.02.2010 um 16:35 schrieb Felix Shnir:

> 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:
>  This setup works well in most cases
> except when the parameter we use contains a dot (.), example:
>  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.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message