struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Struts2 annotation with parameter when using json plugin
Date Fri, 14 Sep 2012 07:23:03 GMT
2012/9/14 Ken McWilliams <ken.mcwilliams@gmail.com>:
> Simply I want to evaluate a property of my action and use it's value
> within an annotation. The following is exactly where I want to use it:
>
> I want to define a excludeProperties parameter at run time.
>
> Consider the following annotation which currently works on the action:
> @Result(name = "success", type = "json", params = {"root", "model",
> "excludeProperties", "myCollection"})
>
> There the actions model has a myCollection collection which I do not
> want serialized.
>
> However I would like to create an exclusion String (a string will do for now).
>
> If I create a getter setter for exclusion, I would expect the
> following annotation to work (which does not):
>
> @Result(name = "success", type = "json", params = {"root", "model",
> "excludeProperties", "${exclusion}"})
>
> Any ideas?

It isn't possible right now, only root can be an expression (and it is
treated as that)

Please register an improvement for that and will see...

https://issues.apache.org/jira/browse/WW


Kind regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message