struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Benitez <steven.beni...@gmail.com>
Subject Re: Strict DMI
Date Thu, 03 Oct 2013 16:02:12 GMT
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 <lukaszlenart@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-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message