Why not just have an @ActionMethod annotation? If its on the action method,
you can invoke it, if not, you can't. The global config option for allowed
methods sounds reasonable (e.g., execute, input, etc.)



On Thu, Oct 3, 2013 at 11:21 AM, Lukasz Lenart <lukaszlen...@apache.org>wrote:

> Hi,
>
> I'm working on extending Strict DMI mode to be enabled by default -
> basically you won't be able to disable it. Thus means you will have to
> define "allowedActions" and "allowedMethods" globally or per action.
> There be no defaults (as for now) so if you don't define
> "allowedActions"/"allowedMethods" calls like these: "myAction!show",
> "method:index", "action:ListUser" won't work. I'm planning to add two
> types of logic: coma separated strings and regex (so you can add "*"
> but then it will be your problem ;-)
>
> To give you a brief example:
>
> <package name="default" extends="struts-default"
> strict-dmi-mode="strings|regex">
>
>     <global-allowed-actions>Search,Index</global-allowed-actions>
>     <global-allowed-methods>index,form,input</global-allowed-methods>
>
>     <action name="HelloWorld" class="example.HelloWorld">
>        <param name="allowedActions">ListUser,EditUser</param>
>        <param name="allowedMethods">index, edit, submit, form</param>
>        <result>/example/HelloWorld.jsp</result>
>     </action>
>
> </package>
>
> @Action(value ="HelloWorld", allowedActions="ListUser,EditUser",
> allowedMethods="index, edit, submit, form")
>
> I have one doubt about global configs with annotations - should I add
> it to @Namespace/@ParentPackage? Or base on xml config? Or maybe
> define new annotation - @Package or @StrictDMI?
>
>
> Regards
> --
> Ɓukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org
> For additional commands, e-mail: dev-h...@struts.apache.org
>
>

Reply via email to