|
From: <tbl...@gm...> - 2006-08-17 22:32:20
|
Hi there,
I've been playing around with MultiActionController for a few days. In
general I really like the idea and the controller seems to very handy.
There is one thing that I'd enjoy. I was wondering about ability to
explicitly specify which methods are 'blessed' ones. Currently methods
are matched using well-defined pattern, but I'd prefer to annotate
methods using Java SE 5 annotations.
What about such a notation *this is just very simple example/idea*:
@Action
public ModelAndView doSomething(@Command("myCommand") MyCommand
command, @Request HttpServletRequest request);
This means that doSoemthing method is 'blessed' one i.e action method,
first parameter is command object, and second is HTTP request
instance. Note that we don't have to follow strict rules in signature
and we have extreme flexibility in defining signatures.
We can define more parameter-level annotations that would pass
instances as parameters into 'blessed' methods. I'm thinking of
@Response, @Session, etc.
Please note, this post is just rough idea, but it's worth
consideration, I believe. Any comments are welcome. I would be pleased
to discuss this subject in details if anyone is interested.
Regards,
Tom
|
|
From: <tbl...@gm...> - 2006-08-17 23:15:34
|
Hi there,
I've been playing around with MultiActionController for a few days. In
general I really like the idea and the controller seems to very handy.
There is one thing that I'd enjoy. I was wondering about ability to
explicitly specify which methods are 'blessed' ones. Currently methods
are matched using well-defined pattern, but I'd prefer to annotate
methods using Java SE 5 annotations.
What about such a notation *this is just very simple example/idea*:
@Action
public ModelAndView doSomething(@Command("myCommand") MyCommand
command, @Request HttpServletRequest request);
This means that doSoemthing method is 'blessed' one i.e action method,
first parameter is command object, and second is HTTP request
instance. Note that we don't have to follow strict rules in signature
and we have extreme flexibility in defining signatures.
We can define more parameter-level annotations that would pass
instances as parameters into 'blessed' methods. I'm thinking of
@Response, @Session, etc.
Please note, this post is just rough idea, but it's worth
consideration, I believe. Any comments are welcome. I would be pleased
to discuss this subject in details if anyone is interested.
Regards,
Tom
|
|
From: Chris W. <chr...@me...> - 2006-08-18 00:42:06
|
The problem with this as I see it would be when you start inheriting=20
actions.
There's quite a few 'standard' actions in, for example, the=20
FormController class. These can't be annotated for back compatibility=20
reasons. You'd be left with some slightly funny logic for determining if=20
you should use the 'blessings' or not, for example check if any methods=20
in the class have an annotation, and if they do require it for all, and=20
do this only on a class by class basis up the inheritance chain. This=20
quickly gets confusing when you're dealing with simple action classes=20
with only one action, if there's no annotation there it might well have=20
been forgotten but you use it anyhow, then when someone else adds an=20
action and remembers the annotation the old action method is confusingly=20
broken.
Tomasz B=C5=82achowicz wrote:
> Hi there,
>
> I've been playing around with MultiActionController for a few days. In
> general I really like the idea and the controller seems to very handy.
> There is one thing that I'd enjoy. I was wondering about ability to
> explicitly specify which methods are 'blessed' ones. Currently methods
> are matched using well-defined pattern, but I'd prefer to annotate
> methods using Java SE 5 annotations.
>
> What about such a notation *this is just very simple example/idea*:
>
> @Action
> public ModelAndView doSomething(@Command("myCommand") MyCommand
> command, @Request HttpServletRequest request);
>
> This means that doSoemthing method is 'blessed' one i.e action method,
> first parameter is command object, and second is HTTP request
> instance. Note that we don't have to follow strict rules in signature
> and we have extreme flexibility in defining signatures.
>
> We can define more parameter-level annotations that would pass
> instances as parameters into 'blessed' methods. I'm thinking of
> @Response, @Session, etc.
>
> Please note, this post is just rough idea, but it's worth
> consideration, I believe. Any comments are welcome. I would be pleased
> to discuss this subject in details if anyone is interested.
>
> Regards,
> Tom
>
> -----------------------------------------------------------------------=
--
> Using Tomcat but need to do more? Need to support web services, securit=
y?
> Get stuff done quickly with pre-integrated technology to make your job =
easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geron=
imo
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=
=3D121642
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
> =20
|
|
From: <tbl...@gm...> - 2006-08-18 09:42:29
|
Q2hyaXMsCgpJIHNlZSB5b3UgcG9pbnQgdmVyeSB3ZWxsLiBNeSBpbnRlbnRpb24gaXMgdG8gaW50 cm9kdWNlIGFubm90YXRpb24KYmFzZWQgd2F5IHRvIHNwZWNpZnkgJ2JsZXNzZWQnIG1ldGhvZHMg dGhhdCBjY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