Hehe.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:
1. http://example.com/foo 2. http://example.com/foo/ 3. http://example.com/foo/indexFor #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: http://code.google.com/p/smarturls-s2/wiki/WalkThroughIt is under the "Index pages and actions" section and the "Extensionless URLs" section.
-bp 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 http://example.com/myapp/mynamespace/ 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] https://issues.apache.org/struts/browse/WW-2163 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
smime.p7s
Description: S/MIME Cryptographic Signature