struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pontarelli <>
Subject Re: [s2] The death of the .action extension
Date Sun, 09 Sep 2007 01:29:47 GMT

I actually did this same exercise for the SmartURLs plugin. It is 
running on a number of live sites we built and works well. I'm glad to 
see that this will be incorporated into core.

One of the things I made sure to handle as well were the indexes for 
URLs like:


For #1 I handle this in the same manner most servers do. If there is an 
action named foo in the namespace / it takes precedence. Otherwise, I 
redirect to #2. Then for #2 it behaves the same as #3. Works great.

Here's the docs I put up on it:

It is under the "Index pages and actions" section and the "Extensionless 
URLs" section.


Don Brown wrote:
> A long time coming, it is now possible (and practical) to get rid of
> extensions altogether, hence the subject, the death of the .action
> extension.  With WW-2163 [1], Struts can make the distinction between
> a setting that has Struts match all URL's, and one that only matches
> URLs with no extension, and furthermore, extension and no extension
> URLs can co-exist.
> Accordingly, I changed the default 'struts.action.extension' setting
> from 'action' to 'action,,'  This allows the <default-action-ref>
> element in struts.xml to do what you would expect - let you define an
> action to handle directory URLs such as
> In a future release, maybe 2.2, I'd like to get rid of the .action
> extension altogether.  I think one of the key strengths of Struts 2 is
> its closeness to the HTTP protocol, and therefore, I think it has
> great potential to be a solid REST platform, an architectural style
> that leverages the features of HTTP rather than fight them.
> Here's to the death of the .action extension! :)
> Don
> [1]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message