You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Don Brown (JIRA)" <ji...@apache.org> on 2006/11/17 08:47:00 UTC

[jira] Closed: (WW-523) Simple Action Namespacing

     [ http://issues.apache.org/struts/browse/WW-523?page=all ]

Don Brown closed WW-523.
------------------------

    Resolution: Not A Problem

> Simple Action Namespacing
> -------------------------
>
>                 Key: WW-523
>                 URL: http://issues.apache.org/struts/browse/WW-523
>             Project: Struts 2
>          Issue Type: New Feature
>          Components: Dispatch
>    Affects Versions: WW 1.4.1
>            Reporter: Michael Day
>         Assigned To: Dick Zetterberg
>            Priority: Minor
>
> I would like a namespacing "feature" added to the webwork 1.x branch.  I think we should be able to use paths for action names.  We would need a configuration option in webwork.properties that defaulted to the old behavior of actions working from any path.
> As far as I can tell, adding this is extremely simple.  You just have to change webwork.dispatcher.ServletDispatcher.getActionName().  I've listed my simplified version below that does not strip the path out.  Note that a configuration parameter needs to be checked to determine which version of the code to execute.
> Original webwork.dispatcher.ServletDispatcher.getActionName():
> ----------------------------------------------------
>    private String getActionName(String name)
>    {
>       // Get action name ("Foo.action" -> "Foo" action)
>       int beginIdx = name.lastIndexOf("/");
>       int endIdx = name.lastIndexOf(actionExtension);
>       return name.substring((beginIdx == -1 ? 0 : beginIdx + 1),
>             endIdx == -1 ? name.length() : endIdx);
>    }
> Changed webwork.dispatcher.ServletDispatcher.getActionName():
> ----------------------------------------------------
>    private String getActionName(String name) {
>        int endIdx = name.lastIndexOf(actionExtension);
>        return name.substring(0, endIdx == -1 ? name.length() : endIdx);
>    }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira